mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[dailymotion] Fix subtitles extraction
This commit is contained in:
parent
0b534d2adc
commit
cbd2ffd031
1 changed files with 7 additions and 5 deletions
|
@ -174,11 +174,13 @@ def _real_extract(self, url):
|
||||||
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_data = metadata.get('subtitles', {}).get('data', {})
|
||||||
subtitles[subtitle_lang] = [{
|
if subtitles_data and isinstance(subtitles_data, dict):
|
||||||
'ext': determine_ext(subtitle_url),
|
for subtitle_lang, subtitle in subtitles_data.items():
|
||||||
'url': subtitle_url,
|
subtitles[subtitle_lang] = [{
|
||||||
} for subtitle_url in subtitle.get('urls', [])]
|
'ext': determine_ext(subtitle_url),
|
||||||
|
'url': subtitle_url,
|
||||||
|
} for subtitle_url in subtitle.get('urls', [])]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue