mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 09:12:40 +01:00
[YoutubeDL] Tweak select_format for video only media
This commit is contained in:
parent
002c0fb511
commit
df15ef8dab
@ -924,8 +924,9 @@ def select_format(self, format_spec, available_formats):
|
|||||||
if f.get('vcodec') != 'none' and f.get('acodec') != 'none']
|
if f.get('vcodec') != 'none' and f.get('acodec') != 'none']
|
||||||
if audiovideo_formats:
|
if audiovideo_formats:
|
||||||
return audiovideo_formats[format_idx]
|
return audiovideo_formats[format_idx]
|
||||||
# for audio only urls, select the best/worst audio format
|
# for audio only (soundcloud) or video only (imgur) urls, select the best/worst audio format
|
||||||
elif all(f.get('acodec') != 'none' for f in available_formats):
|
elif (all(f.get('acodec') != 'none' for f in available_formats) or
|
||||||
|
all(f.get('vcodec') != 'none' for f in available_formats)):
|
||||||
return available_formats[format_idx]
|
return available_formats[format_idx]
|
||||||
elif format_spec == 'bestaudio':
|
elif format_spec == 'bestaudio':
|
||||||
audio_formats = [
|
audio_formats = [
|
||||||
|
Loading…
Reference in New Issue
Block a user