aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-13 04:16:42 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-06-13 04:16:42 +0530
commit551f93885e25c208c581702494d758e58b608992 (patch)
treea078b725359f42436553726fa8ff606e65f37801
parent8326b00aabc332cad3edec246fe5353bea069cb0 (diff)
downloadhypervideo-pre-551f93885e25c208c581702494d758e58b608992.tar.lz
hypervideo-pre-551f93885e25c208c581702494d758e58b608992.tar.xz
hypervideo-pre-551f93885e25c208c581702494d758e58b608992.zip
Ignore `images` formats from merge
-rw-r--r--yt_dlp/YoutubeDL.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 2d37530bc..6d54b2808 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1691,9 +1691,12 @@ class YoutubeDL(object):
formats_info.extend(format_2.get('requested_formats', (format_2,)))
if not allow_multiple_streams['video'] or not allow_multiple_streams['audio']:
- get_no_more = {"video": False, "audio": False}
+ get_no_more = {'video': False, 'audio': False}
for (i, fmt_info) in enumerate(formats_info):
- for aud_vid in ["audio", "video"]:
+ if fmt_info.get('acodec') == fmt_info.get('vcodec') == 'none':
+ formats_info.pop(i)
+ continue
+ for aud_vid in ['audio', 'video']:
if not allow_multiple_streams[aud_vid] and fmt_info.get(aud_vid[0] + 'codec') != 'none':
if get_no_more[aud_vid]:
formats_info.pop(i)
@@ -1801,7 +1804,9 @@ class YoutubeDL(object):
yield f
elif format_spec == 'mergeall':
def selector_function(ctx):
- formats = list(_check_formats(ctx['formats']))
+ formats = ctx['formats']
+ if check_formats:
+ formats = list(_check_formats(formats))
if not formats:
return
merged_format = formats[-1]