aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-10-04 02:55:11 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-10-04 03:08:28 +0530
commitb11c04a8ae07608de8b0d0e1975f92b05270aeb0 (patch)
tree3558a38a42c1ecc3dba9e17b8c81a2ea9422706e
parent5d535b4a559ff114866368bfb3cde38b54f9462b (diff)
downloadhypervideo-pre-b11c04a8ae07608de8b0d0e1975f92b05270aeb0.tar.lz
hypervideo-pre-b11c04a8ae07608de8b0d0e1975f92b05270aeb0.tar.xz
hypervideo-pre-b11c04a8ae07608de8b0d0e1975f92b05270aeb0.zip
Fix `-f mp4` behaving differently from youtube-dl
-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 9c4dd3ec5..f009e9e19 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1944,9 +1944,14 @@ class YoutubeDL(object):
filter_f = lambda f: _filter_f(f) and (
f.get('vcodec') != 'none' or f.get('acodec') != 'none')
else:
- filter_f = ((lambda f: f.get('ext') == format_spec)
- if format_spec in ['mp4', 'flv', 'webm', '3gp', 'm4a', 'mp3', 'ogg', 'aac', 'wav'] # extension
- else (lambda f: f.get('format_id') == format_spec)) # id
+ if format_spec in ('m4a', 'mp3', 'ogg', 'aac'): # audio extension
+ filter_f = lambda f: f.get('ext') == format_spec and f.get('acodec') != 'none'
+ elif format_spec in ('mp4', 'flv', 'webm', '3gp'): # video extension
+ filter_f = lambda f: f.get('ext') == format_spec and f.get('acodec') != 'none' and f.get('vcodec') != 'none'
+ elif format_spec in ('mhtml', ): # storyboards extension
+ filter_f = lambda f: f.get('ext') == format_spec and f.get('acodec') == 'none' and f.get('vcodec') == 'none'
+ else:
+ filter_f = (lambda f: f.get('format_id') == format_spec) # id
def selector_function(ctx):
formats = list(ctx['formats'])