projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a67a36
)
[YoutubeDL] Use DataHandler
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sat, 17 Oct 2015 15:16:40 +0000
(23:16 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sun, 18 Oct 2015 05:44:22 +0000
(13:44 +0800)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index adf70d658b2d24b6b526869da9a8b0005cca5afb..12977bf808024875e5f05cd15136ebe2b96923f5 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-37,6
+37,7
@@
from .compat import (
compat_tokenize_tokenize,
compat_urllib_error,
compat_urllib_request,
compat_tokenize_tokenize,
compat_urllib_error,
compat_urllib_request,
+ compat_urllib_request_DataHandler,
)
from .utils import (
ContentTooShortError,
)
from .utils import (
ContentTooShortError,
@@
-1967,8
+1968,9
@@
class YoutubeDL(object):
debuglevel = 1 if self.params.get('debug_printtraffic') else 0
https_handler = make_HTTPS_handler(self.params, debuglevel=debuglevel)
ydlh = YoutubeDLHandler(self.params, debuglevel=debuglevel)
debuglevel = 1 if self.params.get('debug_printtraffic') else 0
https_handler = make_HTTPS_handler(self.params, debuglevel=debuglevel)
ydlh = YoutubeDLHandler(self.params, debuglevel=debuglevel)
+ data_handler = compat_urllib_request_DataHandler()
opener = compat_urllib_request.build_opener(
opener = compat_urllib_request.build_opener(
- proxy_handler, https_handler, cookie_processor, ydlh)
+ proxy_handler, https_handler, cookie_processor, ydlh
, data_handler
)
# Delete the default user-agent header, which would otherwise apply in
# cases where our custom HTTP handler doesn't come into play
# Delete the default user-agent header, which would otherwise apply in
# cases where our custom HTTP handler doesn't come into play