[francetv] Make subtitles more robust (Closes #7298)

pull/2/head
Sergey M․ 9 years ago
parent 5dadae079b
commit 6e4b8b2891

@ -84,14 +84,12 @@ class FranceTVBaseInfoExtractor(InfoExtractor):
title += ' - %s' % subtitle title += ' - %s' % subtitle
subtitles = {} subtitles = {}
for subtitle_accessibilite in info['subtitles']: subtitles_list = [{
if subtitle_accessibilite['url'] is not '': 'url': subtitle['url'],
if not subtitles: 'ext': subtitle.get('format'),
subtitles['fr'] = [] } for subtitle in info.get('subtitles', []) if subtitle.get('url')]
subtitles['fr'].append({ if subtitles_list:
'ext': subtitle_accessibilite['format'], subtitles['fr'] = subtitles_list
'url': subtitle_accessibilite['url'],
})
return { return {
'id': video_id, 'id': video_id,

Loading…
Cancel
Save