style: 统一 Ruff 代码格式

This commit is contained in:
yml2213
2026-08-30 21:04:52 +08:00
parent c891ac982e
commit 47e19ed7b2
90 changed files with 5574 additions and 2350 deletions
+4 -4
View File
@@ -24,7 +24,7 @@ def parse_proxy_response(text: str) -> tuple[list[str], Optional[str]]:
code = data.get("code")
msg = data.get("msg", "") or ""
if code != 0 and ("白名单" in msg or "添加白名单" in msg):
ip_match = re.search(r'(\d+\.\d+\.\d+\.\d+)', msg)
ip_match = re.search(r"(\d+\.\d+\.\d+\.\d+)", msg)
if ip_match:
return [], ip_match.group(1)
@@ -46,12 +46,12 @@ def parse_proxy_response(text: str) -> tuple[list[str], Optional[str]]:
except (json.JSONDecodeError, ValueError):
pass
if '添加白名单' in text or '白名单' in text:
ip_match = re.search(r'(\d+\.\d+\.\d+\.\d+)', text)
if "添加白名单" in text or "白名单" in text:
ip_match = re.search(r"(\d+\.\d+\.\d+\.\d+)", text)
if ip_match:
return [], ip_match.group(1)
matches = re.findall(r'(\d+\.\d+\.\d+\.\d+):(\d+)', text)
matches = re.findall(r"(\d+\.\d+\.\d+\.\d+):(\d+)", text)
proxies = [f"http://{ip}:{port}" for ip, port in matches]
if proxies:
return proxies, None