diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-01-12 16:49:13 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-01-12 16:49:13 +0100 |
commit | 3446dfb7cb84025f67250be069e44020d3606b84 (patch) | |
tree | d7fc131820c623b23b9630d45e4c6df7906c0d64 /youtube_dl/utils.py | |
parent | db16276b7cc0d106d62bc6b280787bfa4022f4e3 (diff) |
Proper support for changing User-Agents from IEs
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 5 |
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): |