aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-10-26 20:35:28 +0600
committerSergey M․ <dstftw@gmail.com>2015-10-26 20:35:28 +0600
commit6e4b8b28916aaafc6d1b4b4d69a6f667e35d413f (patch)
tree929aa6f2f782a9ddad18f1233fc032b31a7e6d51
parent5dadae079bd053c822353b081e94d9daff333208 (diff)
[francetv] Make subtitles more robust (Closes #7298)
-rw-r--r--youtube_dl/extractor/francetv.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py
index eaaa43958..07115b9d4 100644
--- a/youtube_dl/extractor/francetv.py
+++ b/youtube_dl/extractor/francetv.py
@@ -84,14 +84,12 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
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'],
- })
+ subtitles_list = [{
+ 'url': subtitle['url'],
+ 'ext': subtitle.get('format'),
+ } for subtitle in info.get('subtitles', []) if subtitle.get('url')]
+ if subtitles_list:
+ subtitles['fr'] = subtitles_list
return {
'id': video_id,