diff options
author | Frans de Jonge <fransdejonge@gmail.com> | 2015-10-26 15:11:09 +0100 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-10-26 20:20:15 +0600 |
commit | 5dadae079bd053c822353b081e94d9daff333208 (patch) | |
tree | 5222dd4788a4d7f88b3c91a6b98106d792b0f6bc /youtube_dl | |
parent | cd08d806b1eeff1945fd91b9098421cbfdc8bbcc (diff) |
[francetv] Add subtitles support
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/francetv.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py index 129984a5f..eaaa43958 100644 --- a/youtube_dl/extractor/francetv.py +++ b/youtube_dl/extractor/francetv.py @@ -83,6 +83,16 @@ class FranceTVBaseInfoExtractor(InfoExtractor): if subtitle: title += ' - %s' % subtitle + subtitles = {} + for subtitle_accessibilite in info['subtitles']: + if subtitle_accessibilite['url'] is not '': + if not subtitles: + subtitles['fr'] = [] + subtitles['fr'].append({ + 'ext': subtitle_accessibilite['format'], + 'url': subtitle_accessibilite['url'], + }) + return { 'id': video_id, 'title': title, @@ -91,6 +101,7 @@ class FranceTVBaseInfoExtractor(InfoExtractor): 'duration': int_or_none(info.get('real_duration')) or parse_duration(info['duree']), 'timestamp': int_or_none(info['diffusion']['timestamp']), 'formats': formats, + 'subtitles': subtitles, } |