From 92922fe7f96ac75bb5f9d87f0a9bef5f51383198 Mon Sep 17 00:00:00 2001 From: Felix S Date: Sat, 21 May 2022 12:00:32 +0000 Subject: [PATCH] [rumble] Extract subtitles (#3823) Closes #3132 Authored by: fstirlitz --- yt_dlp/extractor/rumble.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yt_dlp/extractor/rumble.py b/yt_dlp/extractor/rumble.py index 50c383d79..83b688532 100644 --- a/yt_dlp/extractor/rumble.py +++ b/yt_dlp/extractor/rumble.py @@ -77,12 +77,20 @@ def _real_extract(self, url): formats.append(f) self._sort_formats(formats) + subtitles = { + lang: [{ + 'url': sub_info['path'], + 'name': sub_info.get('language') or '', + }] for lang, sub_info in (video.get('cc') or {}).items() if sub_info.get('path') + } + author = video.get('author') or {} return { 'id': video_id, 'title': title, 'formats': formats, + 'subtitles': subtitles, 'thumbnail': video.get('i'), 'timestamp': parse_iso8601(video.get('pubDate')), 'channel': author.get('name'),