summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-11-12 09:42:35 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-11-12 09:42:35 +0100
commitc295490830d46379e89ce2128dc18a6cb2db3b72 (patch)
treeb966ebe34c3ec3fb6bd838a40e8eef75d13cb3bf
parenteb4cb42a028f1050f8c64d9efdd865b2b782e929 (diff)
downloadyoutube-dl-c295490830d46379e89ce2128dc18a6cb2db3b72.tar.gz
youtube-dl-c295490830d46379e89ce2128dc18a6cb2db3b72.tar.xz
youtube-dl-c295490830d46379e89ce2128dc18a6cb2db3b72.zip
[YoutubeDL] Fix bug in the detection of formats that don't contain video (fixes #4150)
If the format requested was not available, we called the method '.get' in None.
-rwxr-xr-xyoutube_dl/YoutubeDL.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 9fdeb4cfb..7951001fa 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -837,14 +837,14 @@ class YoutubeDL(object):
                         format_1, format_2 = rf.split('+')
                         formats_info = (self.select_format(format_1, formats),
                             self.select_format(format_2, formats))
-                        # The first format must contain the video and the
-                        # second the audio
-                        if formats_info[0].get('vcodec') == 'none':
-                            self.report_error('The first format must contain '
-                                'the video, try using "-f %s+%s"' %
-                                (format_2, format_1))
-                            return
                         if all(formats_info):
+                            # The first format must contain the video and the
+                            # second the audio
+                            if formats_info[0].get('vcodec') == 'none':
+                                self.report_error('The first format must '
+                                    'contain the video, try using '
+                                    '"-f %s+%s"' % (format_2, format_1))
+                                return
                             selected_format = {
                                 'requested_formats': formats_info,
                                 'format': rf,