diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-04-16 20:48:17 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-04-16 20:48:17 +0600 |
commit | 820b06480493ab1b3c146c3edfc2c89fc80061cc (patch) | |
tree | 00ea15b86b9cf2e89bb4f58536d3401cf8f0b15a | |
parent | 355c524bfaec10aa8f5ff31bc95d2c50ef1a3113 (diff) |
[srf] Extract subtitles
-rw-r--r-- | youtube_dl/extractor/srf.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/srf.py b/youtube_dl/extractor/srf.py index 4be329a2f..a080eb7ca 100644 --- a/youtube_dl/extractor/srf.py +++ b/youtube_dl/extractor/srf.py @@ -83,6 +83,16 @@ class SrfIE(InfoExtractor): self._sort_formats(formats) + subtitles = {} + subtitles_data = video_data.find('Subtitles') + if subtitles_data is not None: + subtitles_list = [{ + 'url': sub.text, + 'ext': determine_ext(sub.text), + } for sub in subtitles_data] + if subtitles_list: + subtitles['de'] = subtitles_list + return { 'id': video_id, 'display_id': display_id, @@ -90,4 +100,5 @@ class SrfIE(InfoExtractor): 'title': title, 'thumbnails': thumbnails, 'timestamp': timestamp, + 'subtitles': subtitles, } |