初始手动版本 可用
This commit is contained in:
@@ -13,9 +13,9 @@ from urllib3.exceptions import InsecureRequestWarning
|
||||
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
||||
|
||||
class AccountSync:
|
||||
def __init__(self, api_choice: int = 1, max_retries: int = 3, retry_delay: int = 5):
|
||||
def __init__(self, max_retries: int = 3, retry_delay: int = 5):
|
||||
self.api_base_url = "https://cursorapi.nosqli.com/admin" # API地址写死
|
||||
self.api_choice = api_choice # 1=听泉助手池, 2=高质量号池
|
||||
|
||||
self.max_retries = max_retries
|
||||
self.retry_delay = retry_delay
|
||||
|
||||
@@ -28,9 +28,8 @@ class AccountSync:
|
||||
retry_count = 0
|
||||
while retry_count < self.max_retries:
|
||||
try:
|
||||
# 根据选择确定API端点
|
||||
endpoint = f"{self.api_base_url}/api.account/{'addpool' if self.api_choice == 2 else 'add'}"
|
||||
logging.info(f"使用API端点: {endpoint}")
|
||||
# 构建API请求
|
||||
endpoint = f"{self.api_base_url}/api.account/add"
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json"
|
||||
@@ -61,7 +60,6 @@ class AccountSync:
|
||||
"last_name": account_info.get("last_name", ""),
|
||||
"ip_address": proxy_host,
|
||||
"proxy_info": current_proxies,
|
||||
"proxy_data": account_info.get("proxy_data", ""),
|
||||
"country": account_info.get("country", ""),
|
||||
"batch_index": account_info.get("batch_index", "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user