aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-01-12 18:38:23 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-01-12 18:38:23 +0100
commit335959e7787dd42cb47c1267ad294e724ad9431d (patch)
treea34dc51e450a811291721fe2b8c0e7f958bd638c
parent3b83bf8f6a371d90da6157cf219954a666b926ce (diff)
downloadyoutube-dl-335959e7787dd42cb47c1267ad294e724ad9431d.tar.xz
Correct Blip.tv on 2.6, where HTTP headers are case-sensitive (wtf?)
-rw-r--r--youtube_dl/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 08be9e637..51c5ad920 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -516,18 +516,18 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
return ret
def http_request(self, req):
- for h in std_headers:
+ for h,v in std_headers.items():
if h in req.headers:
del req.headers[h]
- req.add_header(h, std_headers[h])
+ req.add_header(h, v)
if 'Youtubedl-no-compression' in req.headers:
if 'Accept-encoding' in req.headers:
del req.headers['Accept-encoding']
del req.headers['Youtubedl-no-compression']
if 'Youtubedl-user-agent' in req.headers:
- if 'User-Agent' in req.headers:
- del req.headers['User-Agent']
- req.headers['User-Agent'] = req.headers['Youtubedl-user-agent']
+ if 'User-agent' in req.headers:
+ del req.headers['User-agent']
+ req.headers['User-agent'] = req.headers['Youtubedl-user-agent']
del req.headers['Youtubedl-user-agent']
return req