1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-27 06:36:49 +01:00

[RTV SLO 4D] Added support for subtitles

This commit is contained in:
Miha Frangež 2021-03-25 11:49:56 +01:00
parent a302001725
commit d81793ea56

View File

@ -84,4 +84,15 @@ class RTVSLO4DIE(InfoExtractor):
'thumbnail': media_info.get('thumbnail_sec'), 'thumbnail': media_info.get('thumbnail_sec'),
'timestamp': unified_timestamp(media_info.get('broadcastDate')), 'timestamp': unified_timestamp(media_info.get('broadcastDate')),
'duration': media_info.get('duration'), 'duration': media_info.get('duration'),
'subtitles': self.extract_subtitles(media_info)
} }
def _get_subtitles(self, media_info):
subs = {}
for sub in media_info.get('subtitles', []):
subs[sub['language']] = [{
'ext': 'vtt',
'url': sub['file']
}]
return subs