[rumble] Extract subtitles (#3823)

Closes #3132
Authored by: fstirlitz
This commit is contained in:
Felix S 2022-05-21 12:00:32 +00:00 committed by GitHub
parent c487cf0010
commit 92922fe7f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'),