mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[utils] Send HTTP/1.1 ALPN extension (#3889)
Some servers may reject requests if not sent (e.g. fingerprinting) Fixes #3878 Authored by: coletdjnz
This commit is contained in:
		| @@ -948,6 +948,13 @@ def make_HTTPS_handler(params, **kwargs): | ||||
|                 password=params.get('client_certificate_password')) | ||||
|         except ssl.SSLError: | ||||
|             raise YoutubeDLError('Unable to load client certificate') | ||||
| 
 | ||||
|     # Some servers may reject requests if ALPN extension is not sent. See: | ||||
|     # https://github.com/python/cpython/issues/85140 | ||||
|     # https://github.com/yt-dlp/yt-dlp/issues/3878 | ||||
|     with contextlib.suppress(NotImplementedError): | ||||
|         context.set_alpn_protocols(['http/1.1']) | ||||
| 
 | ||||
|     return YoutubeDLHTTPSHandler(params, context=context, **kwargs) | ||||
| 
 | ||||
| 
 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 coletdev
					coletdev