diff options
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): |