]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/meta.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class METAIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://video\.meta\.ua/(?:iframe/)?(?P<id>[0-9]+)'
15 'url': 'http://video.meta.ua/5502115.video',
16 'md5': '71b6f3ee274bef16f1ab410f7f56b476',
20 'title': 'Sony Xperia Z camera test [HQ]',
21 'description': 'Xperia Z shoots video in FullHD HDR.',
22 'uploader_id': 'nomobile',
23 'uploader': 'CHЁZA.TV',
24 'upload_date': '20130211',
26 'add_ie': ['Youtube'],
28 'url': 'http://video.meta.ua/iframe/5502115',
29 'only_matching': True,
32 def _real_extract(self
, url
):
33 video_id
= self
._match
_id
(url
)
34 webpage
= self
._download
_webpage
(url
, video_id
)
36 st_html5
= self
._search
_regex
(r
"st_html5\s*=\s*'#([^']+)'", webpage
, 'uppod html5 st')
38 for i
in range(0, len(st_html5
), 3):
39 json_str
+= '�%s;' % st_html5
[i
:i
+ 3]
40 uppod_data
= self
._parse
_json
(unescapeHTML(json_str
), video_id
)
41 error
= uppod_data
.get('customnotfound')
43 raise ExtractorError('%s said: %s' % (self
.IE_NAME
, error
), expected
=True)
45 video_url
= uppod_data
['file']
49 'title': uppod_data
.get('comment') or self
._og
_search
_title
(webpage
),
50 'description': self
._og
_search
_description
(webpage
),
51 'thumbnail': uppod_data
.get('poster') or self
._og
_search
_thumbnail
(webpage
),
52 'duration': int_or_none(self
._og
_search
_property
('video:duration', webpage
)),
54 if 'youtube.com/' in video_url
:
56 '_type': 'url_transparent',