diff options
author | Marian Sigler <m@qjym.de> | 2016-01-12 17:08:55 +0100 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-01-23 01:28:31 +0600 |
commit | 1f16b958b11c4c8503a3555d46bd205540d7aae8 (patch) | |
tree | 2bc56500e1a5c48b10a0f85aa5f5f00c8a12d626 /youtube_dl/extractor/svt.py | |
parent | 4c0d13df9bdf7222fbfa6dde543ffcdb47696392 (diff) |
[SVTPlay] Add subtitle support
Diffstat (limited to 'youtube_dl/extractor/svt.py')
-rw-r--r-- | youtube_dl/extractor/svt.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/svt.py b/youtube_dl/extractor/svt.py index fc20f664b..7ff5ee11a 100644 --- a/youtube_dl/extractor/svt.py +++ b/youtube_dl/extractor/svt.py @@ -37,6 +37,12 @@ class SVTBaseIE(InfoExtractor): }) self._sort_formats(formats) + # SVT does not tell us the language, so we assume swedish. + subtitles = {} + for sr in video_info['subtitleReferences']: + if 'url' in sr: + subtitles.setdefault('sv', []).append({'url': sr['url']}) + duration = video_info.get('materialLength') age_limit = 18 if video_info.get('inappropriateForChildren') else 0 @@ -44,6 +50,7 @@ class SVTBaseIE(InfoExtractor): 'id': video_id, 'title': title, 'formats': formats, + 'subtitles': subtitles, 'thumbnail': thumbnail, 'duration': duration, 'age_limit': age_limit, |