1
0
Fork 0
mirror of https://codeberg.org/polarisfm/youtube-dl.git synced 2024-12-25 01:01:39 +00:00

[utils] Let request headers override standard headers

What was I thinking when writing this?
This commit is contained in:
Philipp Hagemeister 2014-08-26 11:51:48 +02:00
parent 0963f92f23
commit 33ac271ba7

View file

@ -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']