完成 Ruff 全量清理
This commit is contained in:
@@ -27,7 +27,7 @@ def verify_proxy_url(proxy_url: str, timeout: tuple = (3, 5)) -> tuple[bool, str
|
||||
)
|
||||
response.raise_for_status()
|
||||
return True, "代理可用 → 斗鱼可达"
|
||||
except Exception as exc:
|
||||
except Exception as exc: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
|
||||
err_msg = str(exc)
|
||||
if "Tunnel connection failed" in err_msg or "503" in err_msg:
|
||||
detail = "代理拒绝连接(白名单可能未生效)"
|
||||
@@ -75,7 +75,8 @@ def verify_proxies_concurrent(
|
||||
ok, _ = future.result()
|
||||
if ok:
|
||||
available.append(future_map[future])
|
||||
except Exception:
|
||||
except Exception as exc: # noqa: BLE001
|
||||
logger.debug(f"代理并发验证失败: {future_map[future]}: {exc}")
|
||||
continue
|
||||
if available:
|
||||
logger.success(
|
||||
@@ -99,7 +100,8 @@ def verify_proxies_concurrent(
|
||||
if item != future:
|
||||
item.cancel()
|
||||
return proxy_url, msg
|
||||
except Exception:
|
||||
except Exception as exc: # noqa: BLE001
|
||||
logger.debug(f"代理并发验证失败: {proxy_url}: {exc}")
|
||||
continue
|
||||
|
||||
return None, f"共 {len(proxy_urls)} 个代理均不可用"
|
||||
|
||||
Reference in New Issue
Block a user