Revert "[utils] Encode URLs in `YoutubeDLCookieProcessor`"

This reverts commit 915f911e36.

When the request is copied, `unredirected_hdrs` are not copied, which causes issues elsewhere
Reopens #263
This commit is contained in:
pukkandan 2021-04-29 04:49:44 +05:30
parent 07e4a40a9a
commit f5fa042c82
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698
1 changed files with 1 additions and 9 deletions

View File

@ -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