projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0963f92
)
[utils] Let request headers override standard headers
author
Philipp Hagemeister
<phihag@phihag.de>
Tue, 26 Aug 2014 09:51:48 +0000
(11:51 +0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Tue, 26 Aug 2014 09:51:48 +0000
(11:51 +0200)
What was I thinking when writing this?
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 16bc7408a74a535fa55a013866a096bec387d564..4ebdf6a784eaee0f02dd81268991c00a015b881a 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-766,10
+766,9
@@
class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
return ret
def http_request(self, req):
- for h,v in std_headers.items():
- if h in req.headers:
- del req.headers[h]
- req.add_header(h, v)
+ for h, v in std_headers.items():
+ if h not in req.headers:
+ req.add_header(h, v)
if 'Youtubedl-no-compression' in req.headers:
if 'Accept-encoding' in req.headers:
del req.headers['Accept-encoding']