summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-12-07 23:10:57 +0600
committerSergey M․ <dstftw@gmail.com>2015-12-07 23:10:57 +0600
commit3d24bbfbe433e3a2b2257096264bf4e846f6d889 (patch)
tree6afc22caf508ab481ab2c301836b2470cab7a708
parent1775612512aba3c38455e534d423c36c330af35d (diff)
downloadyoutube-dl-3d24bbfbe433e3a2b2257096264bf4e846f6d889.tar.gz
youtube-dl-3d24bbfbe433e3a2b2257096264bf4e846f6d889.tar.xz
youtube-dl-3d24bbfbe433e3a2b2257096264bf4e846f6d889.zip
[YoutubeDL] Check formats for merge to be opposite (#7786)
-rwxr-xr-xyoutube_dl/YoutubeDL.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 9a8c7da05..c642a1fbf 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -1110,6 +1110,12 @@ class YoutubeDL(object):
                                           'contain the video, try using '
                                           '"-f %s+%s"' % (format_2, format_1))
                         return
+                    # Formats must be opposite (video+audio)
+                    if formats_info[0].get('acodec') == 'none' and formats_info[1].get('acodec') == 'none':
+                        self.report_error(
+                            'Both formats %s and %s are video-only, you must specify "-f video+audio"'
+                            % (format_1, format_2))
+                        return
                     output_ext = (
                         formats_info[0]['ext']
                         if self.params.get('merge_output_format') is None