增加了代理平台和日志
This commit is contained in:
@@ -149,17 +149,28 @@ def resolve_working_proxy(
|
||||
api_url: str,
|
||||
whitelist_uid: str = "",
|
||||
whitelist_ukey: str = "",
|
||||
whitelist_platform: str = "xiequ",
|
||||
whitelist_credentials: dict = None,
|
||||
max_attempts: int = 4,
|
||||
log_func: Optional[LogFunc] = None,
|
||||
) -> tuple[Optional[str], str]:
|
||||
"""
|
||||
从代理 API 获取可用代理,自动处理白名单同步。
|
||||
|
||||
保留旧函数签名,供 Web 层代理测试继续使用。
|
||||
支持:
|
||||
- 新参数:whitelist_platform + whitelist_credentials
|
||||
- 旧参数:whitelist_uid + whitelist_ukey(向后兼容)
|
||||
"""
|
||||
# 构建白名单同步器
|
||||
_wl_platform = whitelist_platform or "xiequ"
|
||||
_wl_credentials = whitelist_credentials
|
||||
if not _wl_credentials and whitelist_uid and whitelist_ukey:
|
||||
_wl_platform = "xiequ"
|
||||
_wl_credentials = {"uid": whitelist_uid, "ukey": whitelist_ukey}
|
||||
|
||||
syncer = (
|
||||
DouyuWhitelistSyncer(whitelist_uid, whitelist_ukey)
|
||||
if whitelist_uid and whitelist_ukey
|
||||
DouyuWhitelistSyncer(platform=_wl_platform, credentials=_wl_credentials)
|
||||
if _wl_credentials
|
||||
else None
|
||||
)
|
||||
resolver = ProxyResolver(
|
||||
|
||||
Reference in New Issue
Block a user