1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-08 05:43:44 +08:00

Treat 'custom_sorting' in formats dict with highest priority when reordering for prefer-free-formats

This commit is contained in:
rzhxeo
2013-12-23 05:49:36 +01:00
Unverified
parent 8958b6916c
commit 40ea27c075
+2 -1
View File
@@ -683,7 +683,8 @@ 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') if f.get('height') is not None else -1,
return (f.get('custom_sorting') if f.get('custom_sorting') is not None else 0,
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)