浏览代码

[YoutubeDL] Fix incomplete formats check

Sergey M․ 9 年之前
父节点
当前提交
2e221ca3a8
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      youtube_dl/YoutubeDL.py

+ 3 - 4
youtube_dl/YoutubeDL.py

@@ -1396,12 +1396,11 @@ class YoutubeDL(object):
         # instead of just formats.
         # instead of just formats.
         # This fixes incorrect format selection issue (see
         # This fixes incorrect format selection issue (see
         # https://github.com/rg3/youtube-dl/issues/10083).
         # https://github.com/rg3/youtube-dl/issues/10083).
-        incomplete_formats = all(
+        incomplete_formats = (
             # All formats are video-only or
             # All formats are video-only or
-            f.get('vcodec') != 'none' and f.get('acodec') == 'none' or
+            all(f.get('vcodec') != 'none' and f.get('acodec') == 'none' for f in formats) or
             # all formats are audio-only
             # all formats are audio-only
-            f.get('vcodec') == 'none' and f.get('acodec') != 'none'
-            for f in formats)
+            all(f.get('vcodec') == 'none' and f.get('acodec') != 'none' for f in formats))
 
 
         ctx = {
         ctx = {
             'formats': formats,
             'formats': formats,