不行, 还是用代理池的代理稳定.
This commit is contained in:
3
const.py
3
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"
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user