add anyip proxy
This commit is contained in:
@@ -37,12 +37,20 @@ FR_DATA_IMPULSE_RES = {
|
||||
'http': 'http://ac2b8183c3b02714cbd1__cr.fr:336e7f8f4b17e5bd@gw.dataimpulse.com:823',
|
||||
'https': 'http://ac2b8183c3b02714cbd1__cr.fr:336e7f8f4b17e5bd@gw.dataimpulse.com:823'
|
||||
}
|
||||
|
||||
FR_MOBILE_ANY_IP_STICKY = {
|
||||
'http': 'http://user_6a7f21,type_mobile,country_FR,session_{}:d5c051@portal.anyip.io:1080',
|
||||
'https': 'http://user_6a7f21,type_mobile,country_FR,session_{}:d5c051@portal.anyip.io:1080',
|
||||
}
|
||||
# 八分之一用data_impulse
|
||||
MOBILE_PROXY_LIST = [FR_PROXY_MOB_OXY_STICKY, FR_PROXY_MOB_OXY_STICKY, FR_PROXY_MOB_OXY_STICKY, FR_PROXY_MOB_OXY_STICKY,
|
||||
FR_PROXY_MOB_OXY_STICKY, FR_PROXY_MOB_OXY_STICKY, FR_PROXY_MOB_OXY_STICKY, FR_PROXY_RES_OXY_STICKY,
|
||||
FR_PROXY_MOB_OXY_STICKY, FR_MOBILE_ANY_IP_STICKY, FR_MOBILE_ANY_IP_STICKY, FR_PROXY_RES_OXY_STICKY,
|
||||
FR_PROXY_DATA_IMPULSE_STICKY]
|
||||
|
||||
|
||||
# MOBILE_PROXY_LIST = [FR_MOBILE_ANY_IP_STICKY]
|
||||
|
||||
|
||||
class ProxyManager:
|
||||
|
||||
def __init__(self, logger):
|
||||
@@ -64,6 +72,9 @@ class ProxyManager:
|
||||
if "oxylabs" in _chosen_proxy["http"]:
|
||||
self.logger.info("use oxylabs proxy")
|
||||
_port = random.randint(40001, 49999)
|
||||
elif "anyip" in _chosen_proxy["http"]:
|
||||
self.logger.info("use anyip proxy")
|
||||
_port = random.randint(40001, 49999)
|
||||
else:
|
||||
self.logger.info("use dataimpulse proxy")
|
||||
_port = random.randint(10000, 20000)
|
||||
|
||||
+11
-7
@@ -6,13 +6,17 @@ from proxy_manager.proxy_manager import ProxyManager
|
||||
|
||||
|
||||
def get_address_ip(proxy_to_use):
|
||||
response = requests.get(url="https://api.ipify.org", proxies=proxy_to_use, verify=False,
|
||||
timeout=15)
|
||||
print(response.status_code)
|
||||
if response.status_code == 200:
|
||||
return response.text
|
||||
else:
|
||||
return ""
|
||||
try:
|
||||
response = requests.get(url="https://api.ipify.org", proxies=proxy_to_use, verify=False,
|
||||
timeout=15)
|
||||
print(response.status_code)
|
||||
if response.status_code == 200:
|
||||
return response.text
|
||||
else:
|
||||
return ""
|
||||
except Exception as Error:
|
||||
print(Error)
|
||||
return "error"
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -43,6 +43,8 @@ class Sender:
|
||||
result.proxy = "oxylabs_mob"
|
||||
else:
|
||||
result.proxy = "oxylabs_res"
|
||||
elif "anyip" in self.proxy_to_use["http"]:
|
||||
result.proxy = "anyip"
|
||||
else:
|
||||
result.proxy = "data_impulse"
|
||||
result.id = id
|
||||
|
||||
Reference in New Issue
Block a user