Browse Source

[extractor/common] Fix sorting with custom field preference

master
Sergey M․ 8 years ago
parent
commit
bf8dd79045
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 5 additions and 1 deletions
  1. 6
      youtube_dl/extractor/common.py

6
youtube_dl/extractor/common.py

@ -878,7 +878,11 @@ class InfoExtractor(object):
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…
Cancel
Save