summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-11-01 00:01:08 +0600
committerSergey M․ <dstftw@gmail.com>2015-11-01 00:01:08 +0600
commit76f0c50d3d3e2eb5903b61da08829699e902916d (patch)
tree2e8b414d21267689c13dc9eadab484eb9e4cd468
parentdc519b5421366a8cac681455a817ae25f7f4aa83 (diff)
downloadyoutube-dl-76f0c50d3d3e2eb5903b61da08829699e902916d.tar.gz
youtube-dl-76f0c50d3d3e2eb5903b61da08829699e902916d.tar.xz
youtube-dl-76f0c50d3d3e2eb5903b61da08829699e902916d.zip
[mdr] Fix failed formats processing
-rw-r--r--youtube_dl/extractor/mdr.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/youtube_dl/extractor/mdr.py b/youtube_dl/extractor/mdr.py
index a566c6a2c..88334889e 100644
--- a/youtube_dl/extractor/mdr.py
+++ b/youtube_dl/extractor/mdr.py
@@ -96,8 +96,6 @@ class MDRIE(InfoExtractor):
                 vbr = int_or_none(xpath_text(asset, './bitrateVideo', 'vbr'), 1000)
                 abr = int_or_none(xpath_text(asset, './bitrateAudio', 'abr'), 1000)
 
-                url_formats = []
-
                 ext = determine_ext(url_el.text)
                 if ext == 'm3u8':
                     url_formats = self._extract_m3u8_formats(
@@ -130,7 +128,10 @@ class MDRIE(InfoExtractor):
                             'height': height,
                         })
 
-                    url_formats.append(f)
+                    url_formats = [f]
+
+                if not url_formats:
+                    continue
 
                 if not vbr:
                     for f in url_formats:
@@ -142,8 +143,8 @@ class MDRIE(InfoExtractor):
                             'vcodec': 'none',
                         })
 
-                if url_formats:
-                    formats.extend(url_formats)
+                formats.extend(url_formats)
+
         self._sort_formats(formats)
 
         description = xpath_text(doc, './broadcast/broadcastDescription', 'description')