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',
|
'http': 'http://ac2b8183c3b02714cbd1__cr.fr:336e7f8f4b17e5bd@gw.dataimpulse.com:823',
|
||||||
'https': '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
|
# 八分之一用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,
|
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]
|
FR_PROXY_DATA_IMPULSE_STICKY]
|
||||||
|
|
||||||
|
|
||||||
|
# MOBILE_PROXY_LIST = [FR_MOBILE_ANY_IP_STICKY]
|
||||||
|
|
||||||
|
|
||||||
class ProxyManager:
|
class ProxyManager:
|
||||||
|
|
||||||
def __init__(self, logger):
|
def __init__(self, logger):
|
||||||
@@ -64,6 +72,9 @@ class ProxyManager:
|
|||||||
if "oxylabs" in _chosen_proxy["http"]:
|
if "oxylabs" in _chosen_proxy["http"]:
|
||||||
self.logger.info("use oxylabs proxy")
|
self.logger.info("use oxylabs proxy")
|
||||||
_port = random.randint(40001, 49999)
|
_port = random.randint(40001, 49999)
|
||||||
|
elif "anyip" in _chosen_proxy["http"]:
|
||||||
|
self.logger.info("use anyip proxy")
|
||||||
|
_port = random.randint(40001, 49999)
|
||||||
else:
|
else:
|
||||||
self.logger.info("use dataimpulse proxy")
|
self.logger.info("use dataimpulse proxy")
|
||||||
_port = random.randint(10000, 20000)
|
_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):
|
def get_address_ip(proxy_to_use):
|
||||||
response = requests.get(url="https://api.ipify.org", proxies=proxy_to_use, verify=False,
|
try:
|
||||||
timeout=15)
|
response = requests.get(url="https://api.ipify.org", proxies=proxy_to_use, verify=False,
|
||||||
print(response.status_code)
|
timeout=15)
|
||||||
if response.status_code == 200:
|
print(response.status_code)
|
||||||
return response.text
|
if response.status_code == 200:
|
||||||
else:
|
return response.text
|
||||||
return ""
|
else:
|
||||||
|
return ""
|
||||||
|
except Exception as Error:
|
||||||
|
print(Error)
|
||||||
|
return "error"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class Sender:
|
|||||||
result.proxy = "oxylabs_mob"
|
result.proxy = "oxylabs_mob"
|
||||||
else:
|
else:
|
||||||
result.proxy = "oxylabs_res"
|
result.proxy = "oxylabs_res"
|
||||||
|
elif "anyip" in self.proxy_to_use["http"]:
|
||||||
|
result.proxy = "anyip"
|
||||||
else:
|
else:
|
||||||
result.proxy = "data_impulse"
|
result.proxy = "data_impulse"
|
||||||
result.id = id
|
result.id = id
|
||||||
|
|||||||
Reference in New Issue
Block a user