[utils] Escape URL while sanitizing
authorpukkandan <pukkandan.ytdlp@gmail.com>
Wed, 28 Apr 2021 23:26:09 +0000 (04:56 +0530)
committerdirkf <fieldhouse@gmx.net>
Mon, 6 Jun 2022 15:03:04 +0000 (16:03 +0100)
Closes #31008, #yt-dlp/263

While this fixes the issue in question, it does not try to address the root-cause of the problem
Refer: 915f911e365736227e134ad654601443dbfd7ccbf5fa042c82300218a2d07b95dd6b9c0756745db3

youtube_dl/utils.py

index 4ff27db3d14e82cfdaeb6c5eb29bc85fe50e3d22..8aa2a43a2cb03672e1afa1694adb0822e6ad3c5d 100644 (file)
@@ -2151,7 +2151,7 @@ def sanitize_url(url):
     for mistake, fixup in COMMON_TYPOS:
         if re.match(mistake, url):
             return re.sub(mistake, fixup, url)
-    return url
+    return escape_url(url)
 
 
 def sanitized_Request(url, *args, **kwargs):