projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c0d13d
)
[SVTPlay] Add subtitle support
author
Marian Sigler
<m@qjym.de>
Tue, 12 Jan 2016 16:08:55 +0000
(17:08 +0100)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 22 Jan 2016 19:28:31 +0000
(
01:28
+0600)
youtube_dl/extractor/svt.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/svt.py
b/youtube_dl/extractor/svt.py
index fc20f664b7f4e1e6267e5cbad7a191e723e204e3..7ff5ee11a9130e83af3a9167026d0fd583f9484a 100644
(file)
--- a/
youtube_dl/extractor/svt.py
+++ b/
youtube_dl/extractor/svt.py
@@
-37,6
+37,12
@@
class SVTBaseIE(InfoExtractor):
})
self._sort_formats(formats)
})
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
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,
'id': video_id,
'title': title,
'formats': formats,
+ 'subtitles': subtitles,
'thumbnail': thumbnail,
'duration': duration,
'age_limit': age_limit,
'thumbnail': thumbnail,
'duration': duration,
'age_limit': age_limit,