From eb0f9d68386b9f387e7908675720af67b6c12091 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 6 Jun 2021 17:09:09 +0530 Subject: [PATCH] [zoom] Extract transcripts as subtitles --- yt_dlp/extractor/zoom.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/yt_dlp/extractor/zoom.py b/yt_dlp/extractor/zoom.py index 6579f5ea4..7accb6505 100644 --- a/yt_dlp/extractor/zoom.py +++ b/yt_dlp/extractor/zoom.py @@ -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': {