]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/zoom.py
2 from __future__
import unicode_literals
5 from .common
import InfoExtractor
16 class ZoomIE(InfoExtractor
):
18 _VALID_URL
= r
'(?P<base_url>https?://(?:[^.]+\.)?zoom.us/)rec(?:ording)?/(?:play|share)/(?P<id>[A-Za-z0-9_.-]+)'
20 'url': 'https://economist.zoom.us/rec/play/dUk_CNBETmZ5VA2BwEl-jjakPpJ3M1pcfVYAPRsoIbEByGsLjUZtaa4yCATQuOL3der8BlTwxQePl_j0.EImBkXzTIaPvdZO5',
21 'md5': 'ab445e8c911fddc4f9adc842c2c5d434',
23 'id': 'dUk_CNBETmZ5VA2BwEl-jjakPpJ3M1pcfVYAPRsoIbEByGsLjUZtaa4yCATQuOL3der8BlTwxQePl_j0.EImBkXzTIaPvdZO5',
25 'title': 'China\'s "two sessions" and the new five-year plan',
29 def _real_extract(self
, url
):
30 base_url
, play_id
= self
._match
_valid
_url
(url
).groups()
31 webpage
= self
._download
_webpage
(url
, play_id
)
34 form
= self
._form
_hidden
_inputs
('password_form', webpage
)
35 except ExtractorError
:
38 password
= self
.get_param('videopassword')
41 'This video is protected by a passcode, use the --video-password option', expected
=True)
42 is_meeting
= form
.get('useWhichPasswd') == 'meeting'
43 validation
= self
._download
_json
(
44 base_url
+ 'rec/validate%s_passwd' % ('_meet' if is_meeting
else ''),
45 play_id
, 'Validating passcode', 'Wrong passcode', data
=urlencode_postdata({
46 'id': form
[('meet' if is_meeting
else 'file') + 'Id'],
48 'action': form
.get('action'),
50 if not validation
.get('status'):
51 raise ExtractorError(validation
['errorMessage'], expected
=True)
52 webpage
= self
._download
_webpage
(url
, play_id
)
54 data
= self
._parse
_json
(self
._search
_regex
(
55 r
'(?s)window\.__data__\s*=\s*({.+?});',
56 webpage
, 'data'), play_id
, js_to_json
)
59 for _type
in ('transcript', 'cc'):
60 if data
.get('%sUrl' % _type
):
62 'url': urljoin(base_url
, data
['%sUrl' % _type
]),
68 'title': data
['topic'],
69 'url': data
['viewMp4Url'],
70 'subtitles': subtitles
,
71 'width': int_or_none(data
.get('viewResolvtionsWidth')),
72 'height': int_or_none(data
.get('viewResolvtionsHeight')),
76 'filesize_approx': parse_filesize(data
.get('fileSize')),