Skip to content

Commit

Permalink
workaround for requests 2.32.3
Browse files Browse the repository at this point in the history
  • Loading branch information
freddy36 committed Jun 27, 2024
1 parent 7cc90a5 commit fc2f53b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions audiobookdl/sources/source/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc2f53b

Please sign in to comment.