]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/meta.py
1 from .common
import InfoExtractor
2 from .pladform
import PladformIE
10 class METAIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://video\.meta\.ua/(?:iframe/)?(?P<id>[0-9]+)'
13 'url': 'http://video.meta.ua/5502115.video',
14 'md5': '71b6f3ee274bef16f1ab410f7f56b476',
18 'title': 'Sony Xperia Z camera test [HQ]',
19 'description': 'Xperia Z shoots video in FullHD HDR.',
20 'uploader_id': 'nomobile',
21 'uploader': 'CHЁZA.TV',
22 'upload_date': '20130211',
24 'add_ie': ['Youtube'],
26 'url': 'http://video.meta.ua/iframe/5502115',
27 'only_matching': True,
30 'url': 'http://video.meta.ua/7121015.video',
31 'only_matching': True,
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
36 webpage
= self
._download
_webpage
(url
, video_id
)
38 st_html5
= self
._search
_regex
(
39 r
"st_html5\s*=\s*'#([^']+)'", webpage
, 'uppod html5 st', default
=None)
42 # uppod st decryption algorithm is reverse engineered from function un(s) at uppod.js
44 for i
in range(0, len(st_html5
), 3):
45 json_str
+= '�%s;' % st_html5
[i
:i
+ 3]
46 uppod_data
= self
._parse
_json
(unescapeHTML(json_str
), video_id
)
47 error
= uppod_data
.get('customnotfound')
49 raise ExtractorError('%s said: %s' % (self
.IE_NAME
, error
), expected
=True)
51 video_url
= uppod_data
['file']
55 'title': uppod_data
.get('comment') or self
._og
_search
_title
(webpage
),
56 'description': self
._og
_search
_description
(webpage
, default
=None),
57 'thumbnail': uppod_data
.get('poster') or self
._og
_search
_thumbnail
(webpage
),
58 'duration': int_or_none(self
._og
_search
_property
(
59 'video:duration', webpage
, default
=None)),
61 if 'youtube.com/' in video_url
:
63 '_type': 'url_transparent',
68 pladform_url
= PladformIE
._extract
_url
(webpage
)
70 return self
.url_result(pladform_url
)