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

This commit is contained in:
Sergey M․ 2015-10-26 20:35:28 +06:00
parent 5dadae079b
commit 6e4b8b2891

View File

@ -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,