mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 03:03:01 +00:00
[extractor/common] Fix sorting with custom field preference
This commit is contained in:
parent
c6781156aa
commit
bf8dd79045
1 changed files with 5 additions and 1 deletions
|
@ -878,7 +878,11 @@ def _formats_key(f):
|
|||
f['ext'] = determine_ext(f['url'])
|
||||
|
||||
if isinstance(field_preference, (list, tuple)):
|
||||
return tuple(f.get(field) if f.get(field) is not None else -1 for field in field_preference)
|
||||
return tuple(
|
||||
f.get(field)
|
||||
if f.get(field) is not None
|
||||
else ('' if field == 'format_id' else -1)
|
||||
for field in field_preference)
|
||||
|
||||
preference = f.get('preference')
|
||||
if preference is None:
|
||||
|
|
Loading…
Reference in a new issue