diff --git a/multi_proxy_refill.py b/multi_proxy_refill.py index 4038331..c038e02 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 = "http://api.proxy.roxlabs.io/getProxyIp" +PROXY_API_URL = "https://www.kookeey.net/pickdynamicips" ACCESS_ID = "2207189" SIGN = "10099426b05c7119e9c4dbd6a7a0aa4e" @@ -42,13 +42,14 @@ def fetch_proxies(region_code, n): 从第三方一次性请求 n 条代理,返回格式化列表 """ params = { - "num": n, - "return_type": "json", - "lb": "4", - "sb": "", - "flow": "1", - "regions": region_code, - "protocol": "http" + "auth": "ip", + "n": n, + "p": "http", + "g": region_code, + "type": "json", + "sign": SIGN, + "accessid": ACCESS_ID, + "dl": "," } try: resp = requests.get(PROXY_API_URL, params=params, timeout=10) @@ -84,7 +85,7 @@ def refill_queue(r: redis.Redis, region_name: str, region_code: str, to_fetch = batch - length print(f"[{time.strftime('%H:%M:%S')}] {key} 长度 {length} < {low},一次性拉取 {to_fetch} 条…") - proxies = fetch_proxies2(region_code, to_fetch) + proxies = fetch_proxies(region_code, to_fetch) if proxies: r.rpush(key, *proxies) print(f"[{time.strftime('%H:%M:%S')}] 已入队 {len(proxies)} 条 → 新长度 {r.llen(key)}")