mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[utils] Use update_Request in http_request
This commit is contained in:
parent
ed0291d153
commit
15d260ebaa
1 changed files with 1 additions and 6 deletions
|
@ -778,12 +778,7 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
|
||||||
|
|
||||||
# Substitute URL if any change after escaping
|
# Substitute URL if any change after escaping
|
||||||
if url != url_escaped:
|
if url != url_escaped:
|
||||||
req_type = HEADRequest if req.get_method() == 'HEAD' else compat_urllib_request.Request
|
req = update_Request(req, url=url_escaped)
|
||||||
new_req = req_type(
|
|
||||||
url_escaped, data=req.data, headers=req.headers,
|
|
||||||
origin_req_host=req.origin_req_host, unverifiable=req.unverifiable)
|
|
||||||
new_req.timeout = req.timeout
|
|
||||||
req = new_req
|
|
||||||
|
|
||||||
for h, v in std_headers.items():
|
for h, v in std_headers.items():
|
||||||
# Capitalize is needed because of Python bug 2275: http://bugs.python.org/issue2275
|
# Capitalize is needed because of Python bug 2275: http://bugs.python.org/issue2275
|
||||||
|
|
Loading…
Reference in a new issue