From: Philipp Hagemeister Date: Mon, 5 Jan 2015 21:42:17 +0000 (+0100) Subject: [youtube] Handle cases where format comes without a preference (Fixes #4648) X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=ee61f6f3e2f4d03a3ad9c5ca8f4fc5cd9461bdbc;p=youtube-dl [youtube] Handle cases where format comes without a preference (Fixes #4648) --- 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)