]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/zoom.py
2 from __future__
import unicode_literals
5 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',
28 'skip': 'Recording requires email authentication to access',
31 def _real_extract(self
, url
):
32 base_url
, play_id
= self
._match
_valid
_url
(url
).groups()
33 webpage
= self
._download
_webpage
(url
, play_id
)
36 form
= self
._form
_hidden
_inputs
('password_form', webpage
)
37 except ExtractorError
:
40 password
= self
.get_param('videopassword')
43 'This video is protected by a passcode, use the --video-password option', expected
=True)
44 is_meeting
= form
.get('useWhichPasswd') == 'meeting'
45 validation
= self
._download
_json
(
46 base_url
+ 'rec/validate%s_passwd' % ('_meet' if is_meeting
else ''),
47 play_id
, 'Validating passcode', 'Wrong passcode', data
=urlencode_postdata({
48 'id': form
[('meet' if is_meeting
else 'file') + 'Id'],
50 'action': form
.get('action'),
52 if not validation
.get('status'):
53 raise ExtractorError(validation
['errorMessage'], expected
=True)
54 webpage
= self
._download
_webpage
(url
, play_id
)
56 data
= self
._parse
_json
(self
._search
_regex
(
57 r
'(?s)window\.__data__\s*=\s*({.+?});',
58 webpage
, 'data'), play_id
, js_to_json
)
61 for _type
in ('transcript', 'cc', 'chapter'):
62 if data
.get('%sUrl' % _type
):
64 'url': urljoin(base_url
, data
['%sUrl' % _type
]),
70 if data
.get('viewMp4Url'):
72 'format_note': 'Camera stream',
73 'url': str_or_none(data
.get('viewMp4Url')),
74 'width': int_or_none(data
.get('viewResolvtionsWidth')),
75 'height': int_or_none(data
.get('viewResolvtionsHeight')),
76 'format_id': str_or_none(data
.get('recordingId')),
78 'filesize_approx': parse_filesize(data
.get('fileSize')),
82 if data
.get('shareMp4Url'):
84 'format_note': 'Screen share stream',
85 'url': str_or_none(data
.get('shareMp4Url')),
86 'width': int_or_none(data
.get('shareResolvtionsWidth')),
87 'height': int_or_none(data
.get('shareResolvtionsHeight')),
88 'format_id': str_or_none(data
.get('shareVideoId')),
93 self
._sort
_formats
(formats
)
97 'title': data
.get('topic'),
98 'subtitles': subtitles
,