diff --git a/youtube_dl/extractor/amara.py b/youtube_dl/extractor/amara.py index 59d9c0a18..9cc6781dc 100644 --- a/youtube_dl/extractor/amara.py +++ b/youtube_dl/extractor/amara.py @@ -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