aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-05 22:42:17 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-05 22:42:17 +0100
commitee61f6f3e2f4d03a3ad9c5ca8f4fc5cd9461bdbc (patch)
tree77c6dab02c8c6af73a034e21d3c9ba0e23cf0aae
parent8f9529cd0559bdbe6c568cfd765f9129666a77be (diff)
[youtube] Handle cases where format comes without a preference (Fixes #4648)
-rw-r--r--youtube_dl/extractor/youtube.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index d1bbf0b01..4aa8615b4 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1046,7 +1046,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
for f in formats:
if f['format_id'] in dash_keys:
f['format_id'] = 'nondash-%s' % f['format_id']
- f['preference'] -= 10000
+ f['preference'] = f.get('preference', 0) - 10000
formats.extend(dash_formats)
self._sort_formats(formats)