2 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class IndavideoIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?indavideo\.hu/video/(?P<id>.+)'
12 'url': 'http://indavideo.hu/video/Cicatanc',
13 'md5': 'c8a507a1c7410685f83a06eaeeaafeab',
18 'display_id': 'Cicatanc',
19 'thumbnail': 're:^https?://.*\.jpg$',
21 'uploader': 'cukiajanlo',
22 'uploader_id': '83729',
25 'tags': ['tánc', 'cica', 'cuki', 'cukiajanlo', 'newsroom']
29 'url': 'http://indavideo.hu/video/Vicces_cica_1',
30 'md5': '8c82244ba85d2a2310275b318eb51eac',
33 'title': 'Vicces cica',
35 'display_id': 'Vicces_cica_1',
36 'thumbnail': 're:^https?://.*\.jpg$',
37 'description': 'Játszik a tablettel. :D',
38 'uploader': 'Jet_Pack',
39 'uploader_id': '491217',
42 'tags': ['vicces', 'macska', 'cica', 'ügyes', 'nevetés', 'játszik', 'Cukiság', 'Jet_Pack'],
47 def _real_extract(self, url):
48 video_disp_id = self._match_id(url)
49 webpage = self._download_webpage(url, video_disp_id)
51 embed_url = self._html_search_regex(r'<link rel="video_src" href="(.+?)"/>', webpage, 'embed_url')
52 video_hash = embed_url.split('/')[-1]
54 payload = self._download_json('http://amfphp.indavideo.hu/SYm0json.php/player.playerHandler.getVideoData/' + video_hash, video_disp_id)
55 video_info = payload['data']
57 thumbnails = video_info.get('thumbnails')
59 thumbnails = [{'url': self._proto_relative_url(x)} for x in thumbnails]
61 tags = video_info.get('tags')
63 tags = [x['title'] for x in tags]
66 'id': video_info.get('id'),
67 'title': video_info['title'],
68 'url': video_info['video_file'],
70 'display_id': video_disp_id,
71 'thumbnails': thumbnails,
72 'description': video_info.get('description'),
73 'uploader': video_info.get('user_name'),
74 # TODO: upload date (it's in CET/CEST)
75 'uploader_id': video_info.get('user_id'),
76 'duration': utils.int_or_none(video_info.get('length')),
77 'age_limit': utils.int_or_none(video_info.get('age_limit')),