1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 16:44:32 +01:00

[Amara] Add additional properties to info

This commit is contained in:
Joost Verdoorn 2019-05-15 12:53:00 +02:00 committed by Joost Verdoorn
parent 18844dbac3
commit df6d4f30cd

View File

@ -24,7 +24,10 @@ class AmaraIE(InfoExtractor):
{'ext': 'vtt', 'url': 'https://amara.org/api/videos/jVx79ZKGK1ky/languages/en/subtitles/?format=vtt'},
{'ext': 'srt', 'url': 'https://amara.org/api/videos/jVx79ZKGK1ky/languages/en/subtitles/?format=srt'}
]
}
},
'upload_date': '20160813',
'uploader': 'PBS NewsHour',
'uploader_id': 'PBSNewsHour'
}
},
{
@ -249,7 +252,8 @@ class AmaraIE(InfoExtractor):
{'ext': 'vtt', 'url': 'https://amara.org/api/videos/s8KL7I3jLmh6/languages/my/subtitles/?format=vtt'},
{'ext': 'srt', 'url': 'https://amara.org/api/videos/s8KL7I3jLmh6/languages/my/subtitles/?format=srt'}
]
}
},
'upload_date': '20131206'
}
}
]
@ -284,11 +288,11 @@ class AmaraIE(InfoExtractor):
] + ie_info.get('subtitles', {}).get(language['code'], [])
], filter(lambda language: language['published'], meta.get('languages', [])))))
return {
'id': video_id,
'title': meta.get('title') or ie_info.get('title'),
'description': meta.get('description') or ie_info.get('description'),
'thumbnail': meta.get('thumbnail') or ie_info.get('thumbnail'),
'formats': ie_info.get('formats'),
'subtitles': subtitles
}
info = ie_info.copy()
info.update({ 'id': video_id, 'subtitles': subtitles })
if meta['title']: info.update({ 'title': meta['title' ]})
if meta['description']: info.update({ 'description': meta['description' ]})
if meta['thumbnail']: info.update({ 'thumbnail': meta['thumbnail' ]})
return info