diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 2f242e87b..36ce66e23 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1327,11 +1327,11 @@ class YoutubeDL(object): # Automatically determine file extension if missing if 'ext' not in format: format['ext'] = determine_ext(format['url']).lower() - # Automatically determine protocol if missing (useful for format - # selection purposes) - if 'protocol' not in format: - format['protocol'] = determine_protocol(format) if 'parts' not in format: + # Automatically determine protocol if missing (useful for format + # selection purposes) + if 'protocol' not in format: + format['protocol'] = determine_protocol(format) # Add HTTP headers, so that external programs can use them from the # json output full_format_info = info_dict.copy() diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index b689e5bf5..efd078b69 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -863,7 +863,7 @@ class InfoExtractor(object): if f.get('ext') in ['f4f', 'f4m']: # Not yet supported preference -= 0.5 - proto_preference = 0 if determine_protocol(f) in ['http', 'https'] else -0.1 + proto_preference = 0 if 'url' in f and determine_protocol(f) in ['http', 'https'] else -0.1 if f.get('vcodec') == 'none': # audio only if self._downloader.params.get('prefer_free_formats'):