Proper support for changing User-Agents from IEs
This commit is contained in:
parent
db16276b7c
commit
3446dfb7cb
3 changed files with 11 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue