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