diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2023-07-29 10:40:20 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 22:40:20 +0000 |
commit | 4bf912282a34b58b6b35d8f7e6be535770c89c76 (patch) | |
tree | 829a0271e2e709a8a79f2a9de29f72dea8108d05 /yt_dlp/networking/common.py | |
parent | a15fcd299e767a510debd8dc1646fe863b96ce0e (diff) |
[networking] Remove dot segments during URL normalization (#7662)
This implements RFC3986 5.2.4 remove_dot_segments during the URL normalization process.
Closes #3355, #6526
Authored by: coletdjnz
Diffstat (limited to 'yt_dlp/networking/common.py')
-rw-r--r-- | yt_dlp/networking/common.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/yt_dlp/networking/common.py b/yt_dlp/networking/common.py index 3164df49b..792e062fd 100644 --- a/yt_dlp/networking/common.py +++ b/yt_dlp/networking/common.py @@ -27,10 +27,9 @@ from ..utils import ( classproperty, deprecation_warning, error_to_str, - escape_url, update_url_query, ) -from ..utils.networking import HTTPHeaderDict +from ..utils.networking import HTTPHeaderDict, normalize_url if typing.TYPE_CHECKING: RequestData = bytes | Iterable[bytes] | typing.IO | None @@ -372,7 +371,7 @@ class Request: raise TypeError('url must be a string') elif url.startswith('//'): url = 'http:' + url - self._url = escape_url(url) + self._url = normalize_url(url) @property def method(self): |