From ee61f6f3e2f4d03a3ad9c5ca8f4fc5cd9461bdbc Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 5 Jan 2015 22:42:17 +0100 Subject: [PATCH] [youtube] Handle cases where format comes without a preference (Fixes #4648) --- youtube_dl/extractor/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.40.0