projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b2dca40
)
[YoutubeDL] Ensure protocol is always present
author
Sergey M․
<dstftw@gmail.com>
Sat, 16 Jan 2016 04:10:28 +0000
(10:10 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 16 Jan 2016 04:10:28 +0000
(10:10 +0600)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 18b1443b887ca323e87348636c0febbb878705cc..09d2b18f262690023598dcc0aacf0628729a9c79 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-46,6
+46,7
@@
from .utils import (
DateRange,
DEFAULT_OUTTMPL,
determine_ext,
DateRange,
DEFAULT_OUTTMPL,
determine_ext,
+ determine_protocol,
DownloadError,
encode_compat_str,
encodeFilename,
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 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()
# Add HTTP headers, so that external programs can use them from the
# json output
full_format_info = info_dict.copy()