refactor(curl-impersonate): Remove manual fix for curl proxy SSL

The new version of curl-cffi includes the proper fix for applying ca-bundles to proxy connections making this manual fix no longer required.
This commit is contained in:
rlaphoenix
2024-04-18 09:48:48 +01:00
parent d1ae361afc
commit c859465af2
3 changed files with 17 additions and 20 deletions

View File

@@ -6,7 +6,6 @@ from http.cookiejar import CookieJar
from pathlib import Path
from typing import Any, Generator, MutableMapping, Optional, Union
from curl_cffi import CurlOpt
from curl_cffi.requests import Session
from rich import filesize
@@ -53,11 +52,6 @@ def download(
for one-time request changes like a header, cookie, or proxy. For example,
to request Byte-ranges use e.g., `headers={"Range": "bytes=0-128"}`.
"""
# https://github.com/yifeikong/curl_cffi/issues/6#issuecomment-2028518677
# must be applied here since the `session.curl` is thread-localized
# noinspection PyProtectedMember
session.curl.setopt(CurlOpt.PROXY_CAINFO, session.curl._cacert)
save_dir = save_path.parent
control_file = save_path.with_name(f"{save_path.name}.!dev")