projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c678115
)
[extractor/common] Fix sorting with custom field preference
author
Sergey M․
<dstftw@gmail.com>
Sun, 26 Jun 2016 14:09:07 +0000
(21:09 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 26 Jun 2016 14:09:07 +0000
(21:09 +0700)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 4eda4e2ea6e378eaeee997c5586931bb649cb7dd..e6c15de42aa02becd9ac7d04c586e365f72e7eba 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
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: