aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-12-10 21:29:07 +0600
committerSergey M․ <dstftw@gmail.com>2015-12-10 21:29:07 +0600
commitcbd2ffd031ea1a3388dce96db1d8093daa3c3b77 (patch)
tree9331cdab89fbaf8bf20cc901b0adf58a206d2318 /youtube_dl
parent0b534d2adc56ead4fcb085d886e165dfeaf2852f (diff)
[dailymotion] Fix subtitles extraction
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/dailymotion.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py
index fd6d14d23..e260a0c59 100644
--- a/youtube_dl/extractor/dailymotion.py
+++ b/youtube_dl/extractor/dailymotion.py
@@ -174,11 +174,13 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
uploader_id = metadata.get('owner', {}).get('id')
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 {
'id': video_id,