diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-01-16 10:10:28 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-01-16 10:10:28 +0600 |
commit | b555942428726bd619744a208b5e6cfceb99d8d9 (patch) | |
tree | 694752b17b29987407244a4f911cdcb3f8bdd578 /youtube_dl/YoutubeDL.py | |
parent | b2dca40d8138cb044bd6c6f75a4e87ecb633fc00 (diff) |
[YoutubeDL] Ensure protocol is always present
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 18b1443b8..09d2b18f2 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -46,6 +46,7 @@ from .utils import ( DateRange, DEFAULT_OUTTMPL, determine_ext, + determine_protocol, DownloadError, encode_compat_str, encodeFilename, @@ -1309,6 +1310,10 @@ 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) # Add HTTP headers, so that external programs can use them from the # json output full_format_info = info_dict.copy() |