aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-04-23 16:50:31 +0600
committerSergey M․ <dstftw@gmail.com>2016-04-23 16:50:31 +0600
commite239413fbc9f37996a5fb1ed5b5d211f5a0e613b (patch)
tree131cf793b93c7aa6c9d033f65201cc471bb4163d /youtube_dl
parentfd0ff8bad85595fc7bb7fdafb09be63c502927ad (diff)
[dplay] Extract subtitles (Closes #9284)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/dplay.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/dplay.py b/youtube_dl/extractor/dplay.py
index b2f654ca5..a7994697c 100644
--- a/youtube_dl/extractor/dplay.py
+++ b/youtube_dl/extractor/dplay.py
@@ -129,6 +129,13 @@ class DPlayIE(InfoExtractor):
self._sort_formats(formats)
+ subtitles = {}
+ for lang in ('se', 'sv', 'da', 'nl', 'no'):
+ for format_id in ('web_vtt', 'vtt', 'srt'):
+ subtitle_url = info.get('subtitles_%s_%s' % (lang, format_id))
+ if subtitle_url:
+ subtitles.setdefault(lang, []).append({'url': subtitle_url})
+
return {
'id': video_id,
'display_id': display_id,
@@ -142,4 +149,5 @@ class DPlayIE(InfoExtractor):
'episode_number': int_or_none(info.get('episode')),
'age_limit': int_or_none(info.get('minimum_age')),
'formats': formats,
+ 'subtitles': subtitles,
}