2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from .pladform import PladformIE
13 class METAIE(InfoExtractor):
14 _VALID_URL = r'https?://video\.meta\.ua/(?:iframe/)?(?P<id>[0-9]+)'
16 'url': 'http://video.meta.ua/5502115.video',
17 'md5': '71b6f3ee274bef16f1ab410f7f56b476',
21 'title': 'Sony Xperia Z camera test [HQ]',
22 'description': 'Xperia Z shoots video in FullHD HDR.',
23 'uploader_id': 'nomobile',
24 'uploader': 'CHЁZA.TV',
25 'upload_date': '20130211',
27 'add_ie': ['Youtube'],
29 'url': 'http://video.meta.ua/iframe/5502115',
30 'only_matching': True,
33 'url': 'http://video.meta.ua/7121015.video',
34 'only_matching': True,
37 def _real_extract(self, url):
38 video_id = self._match_id(url)
39 webpage = self._download_webpage(url, video_id)
41 st_html5 = self._search_regex(
42 r"st_html5\s*=\s*'#([^']+)'", webpage, 'uppod html5 st', default=None)
46 for i in range(0, len(st_html5), 3):
47 json_str += '�%s;' % st_html5[i:i + 3]
48 uppod_data = self._parse_json(unescapeHTML(json_str), video_id)
49 error = uppod_data.get('customnotfound')
51 raise ExtractorError('%s said: %s' % (self.IE_NAME, error), expected=True)
53 video_url = uppod_data['file']
57 'title': uppod_data.get('comment') or self._og_search_title(webpage),
58 'description': self._og_search_description(webpage, default=None),
59 'thumbnail': uppod_data.get('poster') or self._og_search_thumbnail(webpage),
60 'duration': int_or_none(self._og_search_property(
61 'video:duration', webpage, default=None)),
63 if 'youtube.com/' in video_url:
65 '_type': 'url_transparent',
70 pladform_url = PladformIE._extract_url(webpage)
72 return self.url_result(pladform_url)