[zoom] Extract transcripts as subtitles

This commit is contained in:
pukkandan 2021-06-06 17:09:09 +05:30
parent d3d8d8184a
commit eb0f9d6838
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698

View File

@ -10,6 +10,7 @@
js_to_json,
parse_filesize,
urlencode_postdata,
urljoin,
)
@ -55,10 +56,19 @@ def _real_extract(self, url):
r'(?s)window\.__data__\s*=\s*({.+?});',
webpage, 'data'), play_id, js_to_json)
subtitles = {}
for _type in ('transcript', 'cc'):
if data.get('%sUrl' % _type):
subtitles[_type] = [{
'url': urljoin(base_url, data['%sUrl' % _type]),
'ext': 'vtt',
}]
return {
'id': play_id,
'title': data['topic'],
'url': data['viewMp4Url'],
'subtitles': subtitles,
'width': int_or_none(data.get('viewResolvtionsWidth')),
'height': int_or_none(data.get('viewResolvtionsHeight')),
'http_headers': {