mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[utils] Escape URLs in sanitized_Request, not sanitize_url
				
					
				
			d2558234cf added escaping of URLs while sanitizing. However, `sanitize_url` may not always receive an actual URL.
Eg: When using `yt-dlp "search query" --default-search ytsearch`, `search query` gets escaped to `search%20query` before being prefixed with `ytsearch:` which is not the intended behavior. So the escaping is moved to `sanitized_Request` instead.This commit is contained in:
		| @@ -239,6 +239,7 @@ class TestUtil(unittest.TestCase): | ||||
|         self.assertEqual(sanitize_url('httpss://foo.bar'), 'https://foo.bar') | ||||
|         self.assertEqual(sanitize_url('rmtps://foo.bar'), 'rtmps://foo.bar') | ||||
|         self.assertEqual(sanitize_url('https://foo.bar'), 'https://foo.bar') | ||||
|         self.assertEqual(sanitize_url('foo bar'), 'foo bar') | ||||
|  | ||||
|     def test_extract_basic_auth(self): | ||||
|         auth_header = lambda url: sanitized_Request(url).get_header('Authorization') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan