Browse Source

[ted] fix extraction for http and rtmp formats(closes #5941)(closes #17572)(closes #17894)

Remita Amine 6 years ago
parent
commit
a94e7c195e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      youtube_dl/extractor/ted.py

+ 2 - 2
youtube_dl/extractor/ted.py

@@ -212,8 +212,6 @@ class TEDIE(InfoExtractor):
 
 
         http_url = None
         http_url = None
         for format_id, resources in resources_.items():
         for format_id, resources in resources_.items():
-            if not isinstance(resources, dict):
-                continue
             if format_id == 'h264':
             if format_id == 'h264':
                 for resource in resources:
                 for resource in resources:
                     h264_url = resource.get('file')
                     h264_url = resource.get('file')
@@ -242,6 +240,8 @@ class TEDIE(InfoExtractor):
                         'tbr': int_or_none(resource.get('bitrate')),
                         'tbr': int_or_none(resource.get('bitrate')),
                     })
                     })
             elif format_id == 'hls':
             elif format_id == 'hls':
+                if not isinstance(resources, dict):
+                    continue
                 stream_url = url_or_none(resources.get('stream'))
                 stream_url = url_or_none(resources.get('stream'))
                 if not stream_url:
                 if not stream_url:
                     continue
                     continue