about summary refs log tree commit diff
path: root/youtube_dl/extractor/ted.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-07-28 21:26:23 +0700
committerSergey M․ <dstftw@gmail.com>2018-07-28 21:26:23 +0700
commit9a984265b90eb0e8a7c26a1edf479fbfcebce0a5 (patch)
treec6053bca917a40791f48644026625271420845ae /youtube_dl/extractor/ted.py
parenta098c99f0d0deb4ad0d5c9b67496582d89970368 (diff)
downloadyoutube-dl-9a984265b90eb0e8a7c26a1edf479fbfcebce0a5.tar.gz
youtube-dl-9a984265b90eb0e8a7c26a1edf479fbfcebce0a5.tar.xz
youtube-dl-9a984265b90eb0e8a7c26a1edf479fbfcebce0a5.zip
[ted] Fix extraction for videos without nativeDownloads (closes #16756, closes #17085)
Diffstat (limited to 'youtube_dl/extractor/ted.py')
-rw-r--r--youtube_dl/extractor/ted.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/youtube_dl/extractor/ted.py b/youtube_dl/extractor/ted.py
index 06a27fd04..dc9c5ce8e 100644
--- a/youtube_dl/extractor/ted.py
+++ b/youtube_dl/extractor/ted.py
@@ -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,