diff --git a/multi_proxy_refill.py b/multi_proxy_refill.py index 2e53a71..fcd97af 100644 --- a/multi_proxy_refill.py +++ b/multi_proxy_refill.py @@ -25,7 +25,7 @@ REFILL_BATCH = 1000 SLEEP_INTERVAL = 10 # 第三方 API 参数 -PROXY_API_URL = "https://www.kookeey.net/pickdynamicips" +PROXY_API_URL = "http://api.proxy.roxlabs.io/getProxyIp" ACCESS_ID = "2207189" SIGN = "10099426b05c7119e9c4dbd6a7a0aa4e" @@ -36,17 +36,13 @@ def fetch_proxies(region_code, n): 从第三方一次性请求 n 条代理,返回格式化列表 """ params = { - "auth": "pwd", - "format": "1", - "n": str(n), - "p": "http", - "gate": "sea", - "g": region_code, - "r": "0", - "type": "json", - "sign": SIGN, - "accessid": ACCESS_ID, - "dl": ",", + "num": n, + "return_type": "json", + "lb": "4", + "sb": "", + "flow": "1", + "regions": region_code, + "protocol": "http" } try: resp = requests.get(PROXY_API_URL, params=params, timeout=10) @@ -63,11 +59,12 @@ def fetch_proxies(region_code, n): result = [] for item in arr: - user = quote(item["username"], safe="") - pwd = quote(item["password"], safe="") + # user = quote(item["username"], safe="") + # pwd = quote(item["password"], safe="") ip = item["ip"] port = item["port"] - result.append(f"http://{user}:{pwd}@{ip}:{port}") + # result.append(f"http://{user}:{pwd}@{ip}:{port}") + result.append(f"http://{ip}:{port}") return result