aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-12-24 12:40:23 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-12-24 12:40:23 +0100
commite6812ac99dfc9117f3dd78425bf4bbe01601ecfd (patch)
tree9be1adb517b9c7287338eddf0ef02dceba16475d /youtube_dl/extractor/common.py
parent719d3927d7072a180682df4dee6fc10fc2170800 (diff)
[spiegel] Use centralized sorting
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 280693d1d..0a90382de 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -438,6 +438,11 @@ class InfoExtractor(object):
def _sort_formats(self, formats):
def _formats_key(f):
+ # TODO remove the following workaround
+ from ..utils import determine_ext
+ if not f.get('ext') and 'url' in f:
+ f['ext'] = determine_ext(f['url'])
+
preference = f.get('preference')
if preference is None:
preference = 0 if f.get('url', '').startswith('http') else -0.1