1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-30 19:57:50 +08:00

[YoutubeDL] Tweak select_format for video only media

This commit is contained in:
Sergey M․ 2015-05-31 04:05:09 +06:00
parent 002c0fb511
commit df15ef8dab

View File

@ -924,8 +924,9 @@ class YoutubeDL(object):
if f.get('vcodec') != 'none' and f.get('acodec') != 'none']
if audiovideo_formats:
return audiovideo_formats[format_idx]
# for audio only urls, select the best/worst audio format
elif all(f.get('acodec') != 'none' for f in available_formats):
# 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) or
all(f.get('vcodec') != 'none' for f in available_formats)):
return available_formats[format_idx]
elif format_spec == 'bestaudio':
audio_formats = [