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
+22
View File
@@ -200,6 +200,7 @@ def _fetch_and_store(trigger: str) -> bool:
return False
password = decrypt_secret(account.password_cipher)
credential = json.loads(decrypt_secret(account.credential_cipher))
from euniv.client import is_qr_password
from euniv.proxy import bind_url, is_proxy_failure, uses_pool
from euniv.proxy_pool import MAX_SWITCHES, retire_if_dead
@@ -211,6 +212,27 @@ def _fetch_and_store(trigger: str) -> bool:
try:
client.restore(credential)
if not client.credential_alive():
if uses_pool(account) and proxy:
from euniv.proxy_pool import force_direct
force_direct(employee_id)
client.close()
client = EunivClient(employee_id, password, proxy=None)
proxy = None
client.restore(credential)
if client.credential_alive():
courses = client.list_courses()
last_exc = None
break
if password and not is_qr_password(password):
from euniv.service import _persist
profile = client.login(manual=False)
with SessionLocal() as saved:
_persist(saved, employee_id, password, client, profile)
courses = client.list_courses()
last_exc = None
break
_cool_failed_sync(employee_id, invalid=True)
return False
courses = client.list_courses()