fix: 黄豆按站点方式保持登录并自动切换播放线路

This commit is contained in:
Nixevol
2026-10-25 05:40:19 +08:00
parent 3fe936fe70
commit f53498f6e6
11 changed files with 444 additions and 197 deletions
+11 -1
View File
@@ -127,7 +127,17 @@ class HttpClient:
options["content"] = content
if timeout is not None:
options["timeout"] = timeout
return self._client_locked().request(method, url, **options)
last_error: Exception | None = None
for attempt in range(3):
try:
return self._client_locked().request(method, url, **options)
except (httpx.HTTPError, TimeoutError, OSError) as exc:
last_error = exc
with self._lock:
self._close_locked()
if attempt < 2:
time.sleep(0.4 * (attempt + 1))
raise RuntimeError(f"请求失败: {last_error}")
def get_bytes(self, url: str, headers: dict | None = None) -> tuple[bytes, str]:
hdrs = {"User-Agent": "RaptDrama"}