[ted] Fix extraction for videos without nativeDownloads (closes #16756, closes #17085)

This commit is contained in:
Sergey M․ 2018-07-28 21:26:23 +07:00
parent a098c99f0d
commit 9a984265b9
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 17 additions and 2 deletions

View File

@ -107,6 +107,19 @@ class TEDIE(InfoExtractor):
'params': {
'skip_download': True,
},
}, {
# no nativeDownloads
'url': 'https://www.ted.com/talks/tom_thum_the_orchestra_in_my_mouth',
'info_dict': {
'id': '1792',
'ext': 'mp4',
'title': 'The orchestra in my mouth',
'description': 'md5:5d1d78650e2f8dfcbb8ebee2951ac29a',
'uploader': 'Tom Thum',
},
'params': {
'skip_download': True,
},
}]
_NATIVE_FORMATS = {
@ -180,8 +193,10 @@ class TEDIE(InfoExtractor):
}
native_downloads = try_get(
talk_info, lambda x: x['downloads']['nativeDownloads'],
dict) or talk_info['nativeDownloads']
talk_info,
(lambda x: x['downloads']['nativeDownloads'],
lambda x: x['nativeDownloads']),
dict) or {}
formats = [{
'url': format_url,