[dailymotion] Fix subtitles extraction

master
Sergey M․ 2015-12-10 21:29:07 +06:00
parent 0b534d2adc
commit cbd2ffd031
1 changed files with 7 additions and 5 deletions

View File

@ -174,7 +174,9 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
uploader_id = metadata.get('owner', {}).get('id')
subtitles = {}
for subtitle_lang, subtitle in metadata.get('subtitles', {}).get('data', {}).items():
subtitles_data = metadata.get('subtitles', {}).get('data', {})
if subtitles_data and isinstance(subtitles_data, dict):
for subtitle_lang, subtitle in subtitles_data.items():
subtitles[subtitle_lang] = [{
'ext': determine_ext(subtitle_url),
'url': subtitle_url,