diff --git a/audiobookdl/sources/source/__init__.py b/audiobookdl/sources/source/__init__.py index c57a5fe..d61aa35 100644 --- a/audiobookdl/sources/source/__init__.py +++ b/audiobookdl/sources/source/__init__.py @@ -177,7 +177,14 @@ def find_all_in_page(self, url: str, regex: str, **kwargs) -> list: get_stream_files = networking.get_stream_files def create_ssl_context(self, options: Any) -> SSLContext: + # Custom SSLContext's are broken in requests version 2.32.0/2.32.1/2.32.2 + # fixed in version 2.32.3: https://github.com/psf/requests/pull/6716 ssl_context: SSLContext = urllib3.util.create_urllib3_context() # type: ignore[attr-defined] + + # Workaround for regression in requests version 2.32.3 + # https://github.com/psf/requests/issues/6730 + ssl_context.load_default_certs() + # Prevent the padding extension from appearing in the TLS ClientHello # It's used by Cloudflare for bot detection # See issue #106