换成sock5代理
This commit is contained in:
2
const.py
2
const.py
@@ -22,7 +22,7 @@ SECRET_KEY = 'iPXte32y1deoySiDq0RwONUJIiIgvjTVhbfCL8tV'
|
|||||||
BUCKET = 'facebook'
|
BUCKET = 'facebook'
|
||||||
|
|
||||||
# PROXY
|
# PROXY
|
||||||
PROXY_HOST = 'http://api.proxy.ip2world.com/getProxyIp?num=1®ions=us&lb=1&return_type=json&protocol=http'
|
PROXY_HOST = 'http://api.proxy.ip2world.com/getProxyIp?num=1®ions=us&lb=1&return_type=json&protocol=sock5'
|
||||||
|
|
||||||
|
|
||||||
api_key = "adf0d1fc9c9313b7f87c18bf9caef01d"
|
api_key = "adf0d1fc9c9313b7f87c18bf9caef01d"
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ def get_proxy_from_api():
|
|||||||
proxy_port = proxy_datum['port']
|
proxy_port = proxy_datum['port']
|
||||||
|
|
||||||
if proxy_ip and proxy_port:
|
if proxy_ip and proxy_port:
|
||||||
return f"http://{proxy_ip}:{proxy_port}"
|
return f"socks5://{proxy_ip}:{proxy_port}"
|
||||||
|
|
||||||
raise OperationFailed("获取代理时出错")
|
raise OperationFailed("获取代理时出错")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user