Skip to content

Commit

Permalink
Revert "[utils] Encode URLs in YoutubeDLCookieProcessor"
Browse files Browse the repository at this point in the history
This reverts commit 915f911.

When the request is copied, `unredirected_hdrs` are not copied, which causes issues elsewhere
Reopens ytdl-org#263
  • Loading branch information
pukkandan committed Apr 28, 2021
1 parent 07e4a40 commit f5fa042
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions yt_dlp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2926,15 +2926,7 @@ def http_response(self, request, response):
# 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


Expand Down

0 comments on commit f5fa042

Please sign in to comment.