use anyip proxy

This commit is contained in:
2025-11-13 16:58:08 +01:00
parent 0f75bc03e1
commit 244af8a290
+21 -19
View File
@@ -74,8 +74,8 @@ class ProxyManager:
def get_link_validate_proxy(self, links_to_validate: list) -> list:
# return [FR_PROXY_RES_PARIS_OXY]
# return [FR_MOBILE_ANY_IP_ROTATING]
return [FR_RES_IP_ROYAL_ROTATING]
return [FR_MOBILE_ANY_IP_ROTATING]
# return [FR_RES_IP_ROYAL_ROTATING]
# return [FR_PROXY_RES_OXY]
# if len(links_to_validate) > 15:
# return [FR_PROXY_RES_OXY, FR_PROXY_MOB_OXY, FR_PROXY_ASOCK_RES_2, FR_DATA_IMPULSE_RES]
@@ -100,28 +100,30 @@ class ProxyManager:
return [FR_PROXY_RES_OXY, FR_PROXY_ASOCK_RES_2, FR_DATA_IMPULSE_RES, FR_ASOCKS_MOBILE_PROXY]
def get_proxy_for_appointment_request(self) -> dict:
return self.get_random_sticky_iproyal_proxy()
# _chosen_proxy = random.choice(MOBILE_PROXY_LIST)
# if "oxylabs" in _chosen_proxy["http"]:
# self.logger.info("use oxylabs proxy")
# _port = random.randint(900000000, 995869818)
# 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)
# self.logger.info("generated port is {}".format(_port))
# _proxy_to_use = {}
# _proxy_to_use["http"] = _chosen_proxy["http"].format(_port)
# _proxy_to_use["https"] = _chosen_proxy["https"].format(_port)
# return _proxy_to_use
# return self.get_random_sticky_iproyal_proxy()
_chosen_proxy = random.choice(MOBILE_PROXY_LIST)
if "oxylabs" in _chosen_proxy["http"]:
self.logger.info("use oxylabs proxy")
_port = random.randint(900000000, 995869818)
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)
self.logger.info("generated port is {}".format(_port))
_proxy_to_use = {}
_proxy_to_use["http"] = _chosen_proxy["http"].format(_port)
_proxy_to_use["https"] = _chosen_proxy["https"].format(_port)
return _proxy_to_use
if __name__ == '__main__':
_logger = logging.getLogger()
_proxy = ProxyManager(logger=_logger)
_proxise = _proxy.get_random_sticky_iproyal_proxy()
# _proxise = _proxy.get_random_sticky_iproyal_proxy()
# _proxise = _proxy.get_proxy_for_appointment_request()
_proxise = _proxy.get_link_validate_proxy([])[0]
print(_proxise)
response = requests.get(
"https://ip.oxylabs.io/location",