1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-25 01:07:19 +00:00

Make prefer_free_formats sorting more robust

This commit is contained in:
rzhxeo 2013-12-18 21:25:13 +01:00
parent bfaae0a768
commit 62d68c43ed

View file

@ -674,7 +674,9 @@ class YoutubeDL(object):
except ValueError:
ext_ord = -1
# We only compare the extension if they have the same height and width
return (f.get('height'), f.get('width'), ext_ord)
return (f.get('height') if f.get('height') is not None else -1,
f.get('width') if f.get('width') is not None else -1,
ext_ord)
formats = sorted(formats, key=_free_formats_key)
info_dict['formats'] = formats