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