Browse Source

[dailymotion] Fix subtitles extraction

totalwebcasting
Sergey M․ 9 years ago
parent
commit
cbd2ffd031
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      youtube_dl/extractor/dailymotion.py

+ 7
- 5
youtube_dl/extractor/dailymotion.py View File

@ -174,11 +174,13 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
uploader_id = metadata.get('owner', {}).get('id') uploader_id = metadata.get('owner', {}).get('id')
subtitles = {} subtitles = {}
for subtitle_lang, subtitle in metadata.get('subtitles', {}).get('data', {}).items():
subtitles[subtitle_lang] = [{
'ext': determine_ext(subtitle_url),
'url': subtitle_url,
} for subtitle_url in subtitle.get('urls', [])]
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,
} for subtitle_url in subtitle.get('urls', [])]
return { return {
'id': video_id, 'id': video_id,


Loading…
Cancel
Save