From d81793ea564e44219aa06f806caa8d46a242d2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miha=20Frange=C5=BE?= Date: Thu, 25 Mar 2021 11:49:56 +0100 Subject: [PATCH] [RTV SLO 4D] Added support for subtitles --- youtube_dl/extractor/rtvslo.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/youtube_dl/extractor/rtvslo.py b/youtube_dl/extractor/rtvslo.py index ff8e59e71..1264a8752 100644 --- a/youtube_dl/extractor/rtvslo.py +++ b/youtube_dl/extractor/rtvslo.py @@ -84,4 +84,15 @@ class RTVSLO4DIE(InfoExtractor): 'thumbnail': media_info.get('thumbnail_sec'), 'timestamp': unified_timestamp(media_info.get('broadcastDate')), '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