From 057204caeea3d1995ab83f7b5adcee318d161aaa Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 26 Aug 2025 22:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=A1=8C,=20=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=90=86=E6=B1=A0=E7=9A=84=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E7=A8=B3=E5=AE=9A.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- const.py | 3 +-- spider/task.py | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/const.py b/const.py index ff0a8c1..9770134 100644 --- a/const.py +++ b/const.py @@ -22,8 +22,7 @@ SECRET_KEY = 'iPXte32y1deoySiDq0RwONUJIiIgvjTVhbfCL8tV' BUCKET = 'facebook' # PROXY -PROXY_HOST = 'http://123.58.209.87:5010/get/?type=https' - +PROXY_HOST = 'http://123.58.209.87:5010/pop/?type=https' api_key = "adf0d1fc9c9313b7f87c18bf9caef01d" api_url = "http://local.adspower.net:50325" diff --git a/spider/task.py b/spider/task.py index 43f5a66..279eb81 100644 --- a/spider/task.py +++ b/spider/task.py @@ -24,7 +24,6 @@ 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): @@ -853,9 +852,7 @@ def playwright_m_login(username, password, code_2fa=None): with lock: with sync_playwright() as playwright: update_windows_distinguish() - proxy_url = ProxyChecker(timeout=8).get_valid_proxy_url() - if proxy_url is None: - raise OperationFailed("获取代理失败") + proxy_url = get_proxy_from_api() logger.info(f"使用proxi={proxy_url}") browser = playwright.chromium.launch(