[YoutubeDL] Don't dowload formats for merging if the first doesn't contain the video...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 9 Nov 2014 09:59:56 +0000 (10:59 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 9 Nov 2014 09:59:56 +0000 (10:59 +0100)
youtube_dl/YoutubeDL.py

index 8732f3db4e3a7c0eb91182954f0c3a7801dc681c..172180d1402444258f7a9501693e235872d85dac 100755 (executable)
@@ -835,6 +835,13 @@ 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):
                             selected_format = {
                                 'requested_formats': formats_info,