2 from __future__ import unicode_literals
5 from .common import InfoExtractor
13 class IndavideoEmbedIE(InfoExtractor):
14 _VALID_URL = r'https?://(?:(?:embed\.)?indavideo\.hu/player/video/|assets\.indavideo\.hu/swf/player\.swf\?.*\b(?:v(?:ID|id))=)(?P<id>[\da-f]+)'
16 'url': 'http://indavideo.hu/player/video/1bdc3c6d80/',
17 'md5': 'f79b009c66194acacd40712a6778acfa',
23 'thumbnail': 're:^https?://.*\.jpg$',
24 'uploader': 'cukiajanlo',
25 'uploader_id': '83729',
26 'timestamp': 1439193826,
27 'upload_date': '20150810',
30 'tags': ['tánc', 'cica', 'cuki', 'cukiajanlo', 'newsroom'],
33 'url': 'http://embed.indavideo.hu/player/video/1bdc3c6d80?autostart=1&hide=1',
34 'only_matching': True,
36 'url': 'http://assets.indavideo.hu/swf/player.swf?v=fe25e500&vID=1bdc3c6d80&autostart=1&hide=1&i=1',
37 'only_matching': True,
40 def _real_extract(self, url):
41 video_id = self._match_id(url)
43 video = self._download_json(
44 'http://amfphp.indavideo.hu/SYm0json.php/player.playerHandler.getVideoData/%s' % video_id,
47 video_id = video['id']
48 title = video['title']
50 video_urls = video.get('video_files', [])
51 video_file = video.get('video_file')
53 video_urls.append(video_file)
54 video_urls = list(set(video_urls))
56 video_prefix = video_urls[0].rsplit('/', 1)[0]
58 for flv_file in video.get('flv_files', []):
59 flv_url = '%s/%s' % (video_prefix, flv_file)
60 if flv_url not in video_urls:
61 video_urls.append(flv_url)
65 'height': self._search_regex(r'\.(\d{3,4})\.mp4$', video_url, 'height', default=None),
66 } for video_url in video_urls]
67 self._sort_formats(formats)
69 timestamp = video.get('date')
71 # upload date is in CEST
72 timestamp = parse_iso8601(timestamp + ' +0200', ' ')
75 'url': self._proto_relative_url(thumbnail)
76 } for thumbnail in video.get('thumbnails', [])]
78 tags = [tag['title'] for tag in video.get('tags', [])]
83 'description': video.get('description'),
84 'thumbnails': thumbnails,
85 'uploader': video.get('user_name'),
86 'uploader_id': video.get('user_id'),
87 'timestamp': timestamp,
88 'duration': int_or_none(video.get('length')),
89 'age_limit': parse_age_limit(video.get('age_limit')),
95 class IndavideoIE(InfoExtractor):
96 _VALID_URL = r'https?://(?:www\.)?indavideo\.hu/video/(?P<id>[^/#?]+)'
98 'url': 'http://indavideo.hu/video/Vicces_cica_1',
99 'md5': '8c82244ba85d2a2310275b318eb51eac',
102 'display_id': 'Vicces_cica_1',
104 'title': 'Vicces cica',
105 'description': 'Játszik a tablettel. :D',
106 'thumbnail': 're:^https?://.*\.jpg$',
107 'uploader': 'Jet_Pack',
108 'uploader_id': '491217',
109 'timestamp': 1390821212,
110 'upload_date': '20140127',
113 'tags': ['vicces', 'macska', 'cica', 'ügyes', 'nevetés', 'játszik', 'Cukiság', 'Jet_Pack'],
117 def _real_extract(self, url):
118 display_id = self._match_id(url)
120 webpage = self._download_webpage(url, display_id)
121 embed_url = self._search_regex(
122 r'<link[^>]+rel="video_src"[^>]+href="(.+?)"', webpage, 'embed url')
125 '_type': 'url_transparent',
126 'ie_key': 'IndavideoEmbed',
128 'display_id': display_id,