From f5fa042c82300218a2d07b95dd6b9c0756745db3 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 29 Apr 2021 04:49:44 +0530 Subject: [PATCH] Revert "[utils] Encode URLs in `YoutubeDLCookieProcessor`" This reverts commit 915f911e365736227e134ad654601443dbfd7ccb. When the request is copied, `unredirected_hdrs` are not copied, which causes issues elsewhere Reopens #263 --- yt_dlp/utils.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 9ddd6453f..1322c3aaa 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -2926,15 +2926,7 @@ class YoutubeDLCookieProcessor(compat_urllib_request.HTTPCookieProcessor): # response.headers[set_cookie_header] = set_cookie_escaped return compat_urllib_request.HTTPCookieProcessor.http_response(self, request, response) - def http_request(self, request): - # If the URL contains non-ASCII characters, the cookies - # are lost before the request reaches YoutubeDLHandler. - # So we percent encode the url before adding cookies - # See: https://github.com/yt-dlp/yt-dlp/issues/263 - request = update_Request(request, url=escape_url(request.get_full_url())) - return compat_urllib_request.HTTPCookieProcessor.http_request(self, request) - - https_request = http_request + https_request = compat_urllib_request.HTTPCookieProcessor.http_request https_response = http_response