feat: 自动代理改为向接口领取,去掉 ProxyHub 和代理列表

This commit is contained in:
2026-11-17 21:15:41 +08:00
parent 19db13b360
commit 2fc5a0421b
14 changed files with 559 additions and 1743 deletions
+43 -8
View File
@@ -507,11 +507,29 @@ def _live(db: Session, employee_id: str, client_factory, read):
except SessionExpired:
if is_qr_password(password):
raise RuntimeError("扫码登录已失效,请重新扫码登录") from None
try:
client.authorize(client.login(manual=False, auto_attempts=attempts))
except ManualJigsaw:
raise RuntimeError("登录需要重新验证,请重新登录") from None
data = read(client)
from euniv.proxy import uses_pool
if uses_pool(account) and getattr(client, "proxy", None):
from euniv.proxy_pool import force_direct
force_direct(employee_id)
client.close()
client = client_factory(employee_id, password, None)
client.restore(credential)
if client.credential_alive():
data = read(client)
else:
try:
client.authorize(client.login(manual=False, auto_attempts=attempts))
except ManualJigsaw:
raise RuntimeError("登录需要重新验证,请重新登录") from None
data = read(client)
else:
try:
client.authorize(client.login(manual=False, auto_attempts=attempts))
except ManualJigsaw:
raise RuntimeError("登录需要重新验证,请重新登录") from None
data = read(client)
updated = client.export_credential()
with _credential_lock(employee_id):
db.refresh(account)
@@ -609,9 +627,26 @@ def _refresh_one(employee_id: str, attempts: int, client_factory) -> None:
elif is_qr_password(password):
valid = False
else:
profile = client.login(manual=False, auto_attempts=attempts)
_persist(db, employee_id, password, client, profile)
valid = True
from euniv.proxy import uses_pool
if uses_pool(account) and getattr(client, "proxy", None):
from euniv.proxy_pool import force_direct
force_direct(employee_id)
client.close()
client = client_factory(employee_id, password, None)
client.restore(previous)
if client.credential_alive():
valid = True
checked_alive = True
else:
profile = client.login(manual=False, auto_attempts=attempts)
_persist(db, employee_id, password, client, profile)
valid = True
else:
profile = client.login(manual=False, auto_attempts=attempts)
_persist(db, employee_id, password, client, profile)
valid = True
if valid:
hours = _month_hours(client)
break