aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-01-12 16:49:13 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-01-12 16:49:13 +0100
commit3446dfb7cb84025f67250be069e44020d3606b84 (patch)
treed7fc131820c623b23b9630d45e4c6df7906c0d64 /youtube_dl/utils.py
parentdb16276b7cc0d106d62bc6b280787bfa4022f4e3 (diff)
downloadyoutube-dl-3446dfb7cb84025f67250be069e44020d3606b84.tar.xz
Proper support for changing User-Agents from IEs
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 0e37390a2..08be9e637 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -524,6 +524,11 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
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']
+ del req.headers['Youtubedl-user-agent']
return req
def http_response(self, req, resp):