feat: 添加代理支持

- 在 .env 中通过 PROXY_URL 配置代理
- 支持 http/https/socks4/socks5 代理
- 所有网络请求(curl_cffi 和 requests)都走代理
- 服务类构造函数新增 proxies 参数传递代理配置
This commit is contained in:
Debug Assistant
2026-02-20 00:05:03 +08:00
parent 91b187903c
commit 6798426c7b
6 changed files with 47 additions and 13 deletions

View File

@@ -25,6 +25,7 @@ class UserAgreementService:
user_agent: Optional[str] = None,
cf_clearance: Optional[str] = None,
timeout: int = 15,
proxies: Optional[Dict[str, str]] = None,
) -> Dict[str, Any]:
"""
同意 TOS 版本。
@@ -85,6 +86,7 @@ class UserAgreementService:
data=data,
impersonate=impersonate or "chrome120",
timeout=timeout,
proxies=proxies or {},
)
hex_reply = response.content.hex()
grpc_status = response.headers.get("grpc-status")