aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-03-31 22:55:49 +0600
committerSergey M․ <dstftw@gmail.com>2016-03-31 22:55:49 +0600
commit15d260ebaa48409112270685d306a5d9152260c4 (patch)
tree0e4281bcbfba30952f9f3b4f91333654df1166b8 /youtube_dl/utils.py
parented0291d1533600b21903cb98f070791a20e47433 (diff)
[utils] Use update_Request in http_request
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 4532b737b..5c4ab2748 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -778,12 +778,7 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
# Substitute URL if any change after escaping
if url != url_escaped:
- req_type = HEADRequest if req.get_method() == 'HEAD' else compat_urllib_request.Request
- 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
+ req = update_Request(req, url=url_escaped)
for h, v in std_headers.items():
# Capitalize is needed because of Python bug 2275: http://bugs.python.org/issue2275