fix: 更新代理请求参数以使用新的认证方式并修复返回格式
This commit is contained in:
parent
eb5f8bf1d0
commit
41a74e7408
@ -42,10 +42,13 @@ def fetch_proxies(region_code, n):
|
||||
从第三方一次性请求 n 条代理,返回格式化列表
|
||||
"""
|
||||
params = {
|
||||
"auth": "ip",
|
||||
"auth": "pwd",
|
||||
"format": "1",
|
||||
"n": n,
|
||||
"p": "http",
|
||||
"gate": "global",
|
||||
"g": region_code,
|
||||
"r": "0",
|
||||
"type": "json",
|
||||
"sign": SIGN,
|
||||
"accessid": ACCESS_ID,
|
||||
@ -66,12 +69,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://{ip}:{port}")
|
||||
result.append(f"http://{user}:{pwd}@{ip}:{port}")
|
||||
# result.append(f"http://{ip}:{port}")
|
||||
|
||||
return result
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user