更改登录为本地校验获取代理

This commit is contained in:
work
2025-08-26 22:18:15 +08:00
parent 781f7707f8
commit 2a861ccd90
2 changed files with 181 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ import const
from const import BUCKET, BASE_PATH
from exceptions import AuthException, OperationFailed
from miniofile import client, put_object
from spider.proxy_valid import ProxyChecker
def sleep(a, b=None):
@@ -852,7 +853,9 @@ def playwright_m_login(username, password, code_2fa=None):
with lock:
with sync_playwright() as playwright:
update_windows_distinguish()
proxy_url = get_proxy_from_api()
proxy_url = ProxyChecker(timeout=8).get_valid_proxy_url()
if proxy_url is None:
raise OperationFailed("获取代理失败")
logger.info(f"使用proxi={proxy_url}")
browser = playwright.chromium.launch(