mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-07 06:55:40 +02:00
[extractor/zoom] Fix extractor (#6741)
Authored by: shreyasminocha Closes #6677
This commit is contained in:
parent
faa0332ed6
commit
79c77e85b7
@ -5,6 +5,7 @@
|
|||||||
str_or_none,
|
str_or_none,
|
||||||
js_to_json,
|
js_to_json,
|
||||||
parse_filesize,
|
parse_filesize,
|
||||||
|
traverse_obj,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
urljoin,
|
urljoin,
|
||||||
)
|
)
|
||||||
@ -53,6 +54,9 @@ def _real_extract(self, url):
|
|||||||
r'(?s)window\.__data__\s*=\s*({.+?});',
|
r'(?s)window\.__data__\s*=\s*({.+?});',
|
||||||
webpage, 'data'), play_id, js_to_json)
|
webpage, 'data'), play_id, js_to_json)
|
||||||
|
|
||||||
|
data = self._download_json(
|
||||||
|
f'{base_url}nws/recording/1.0/play/info/{data["fileId"]}', play_id)['result']
|
||||||
|
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
for _type in ('transcript', 'cc', 'chapter'):
|
for _type in ('transcript', 'cc', 'chapter'):
|
||||||
if data.get('%sUrl' % _type):
|
if data.get('%sUrl' % _type):
|
||||||
@ -67,11 +71,11 @@ def _real_extract(self, url):
|
|||||||
formats.append({
|
formats.append({
|
||||||
'format_note': 'Camera stream',
|
'format_note': 'Camera stream',
|
||||||
'url': str_or_none(data.get('viewMp4Url')),
|
'url': str_or_none(data.get('viewMp4Url')),
|
||||||
'width': int_or_none(data.get('viewResolvtionsWidth')),
|
'width': int_or_none(traverse_obj(data, ('viewResolvtions', 0))),
|
||||||
'height': int_or_none(data.get('viewResolvtionsHeight')),
|
'height': int_or_none(traverse_obj(data, ('viewResolvtions', 1))),
|
||||||
'format_id': str_or_none(data.get('recordingId')),
|
'format_id': str_or_none(traverse_obj(data, ('recording', 'id'))),
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'filesize_approx': parse_filesize(data.get('fileSize')),
|
'filesize_approx': parse_filesize(str_or_none(traverse_obj(data, ('recording', 'fileSizeInMB')))),
|
||||||
'preference': 0
|
'preference': 0
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -79,16 +83,16 @@ def _real_extract(self, url):
|
|||||||
formats.append({
|
formats.append({
|
||||||
'format_note': 'Screen share stream',
|
'format_note': 'Screen share stream',
|
||||||
'url': str_or_none(data.get('shareMp4Url')),
|
'url': str_or_none(data.get('shareMp4Url')),
|
||||||
'width': int_or_none(data.get('shareResolvtionsWidth')),
|
'width': int_or_none(traverse_obj(data, ('shareResolvtions', 0))),
|
||||||
'height': int_or_none(data.get('shareResolvtionsHeight')),
|
'height': int_or_none(traverse_obj(data, ('shareResolvtions', 1))),
|
||||||
'format_id': str_or_none(data.get('shareVideoId')),
|
'format_id': str_or_none(traverse_obj(data, ('shareVideo', 'id'))),
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'preference': -1
|
'preference': -1
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': play_id,
|
'id': play_id,
|
||||||
'title': data.get('topic'),
|
'title': str_or_none(traverse_obj(data, ('meet', 'topic'))),
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'http_headers': {
|
'http_headers': {
|
||||||
|
Loading…
Reference in New Issue
Block a user