Add bestvideo and worstvideo to special format names (#2163)
This commit is contained in:
parent
aba77bbfc2
commit
bc6d597828
4 changed files with 45 additions and 15 deletions
|
@ -667,6 +667,18 @@ class YoutubeDL(object):
|
|||
if f.get('vcodec') == 'none']
|
||||
if audio_formats:
|
||||
return audio_formats[0]
|
||||
elif format_spec == 'bestvideo':
|
||||
video_formats = [
|
||||
f for f in available_formats
|
||||
if f.get('acodec') == 'none']
|
||||
if video_formats:
|
||||
return video_formats[-1]
|
||||
elif format_spec == 'worstvideo':
|
||||
video_formats = [
|
||||
f for f in available_formats
|
||||
if f.get('acodec') == 'none']
|
||||
if video_formats:
|
||||
return video_formats[0]
|
||||
else:
|
||||
extensions = ['mp4', 'flv', 'webm', '3gp']
|
||||
if format_spec in extensions:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue