Skip to content

Commit

Permalink
refactor(curl-impersonate): Remove manual fix for proxy SSL, update c…
Browse files Browse the repository at this point in the history
…url-cffi

The new version of curl-cffi includes the proper fix for applying ca-bundles to proxy connections making this manual fix no longer required.
  • Loading branch information
rlaphoenix committed Apr 18, 2024
1 parent d1ae361 commit df947cc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
6 changes: 0 additions & 6 deletions devine/core/downloaders/curl_impersonate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
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

Expand Down Expand Up @@ -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")

Expand Down
29 changes: 16 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ subtitle-filter = "^1.4.9"
Unidecode = "^1.3.8"
urllib3 = "^2.2.1"
chardet = "^5.2.0"
curl-cffi = "^0.6.2"
curl-cffi = "^0.7.0b4"
language-data = "^1.2.0"
marisa-trie = "^1.1.0"

Expand Down

0 comments on commit df947cc

Please sign in to comment.