use anyip proxy
This commit is contained in:
@@ -74,8 +74,8 @@ class ProxyManager:
|
|||||||
|
|
||||||
def get_link_validate_proxy(self, links_to_validate: list) -> list:
|
def get_link_validate_proxy(self, links_to_validate: list) -> list:
|
||||||
# return [FR_PROXY_RES_PARIS_OXY]
|
# return [FR_PROXY_RES_PARIS_OXY]
|
||||||
# return [FR_MOBILE_ANY_IP_ROTATING]
|
return [FR_MOBILE_ANY_IP_ROTATING]
|
||||||
return [FR_RES_IP_ROYAL_ROTATING]
|
# return [FR_RES_IP_ROYAL_ROTATING]
|
||||||
# return [FR_PROXY_RES_OXY]
|
# return [FR_PROXY_RES_OXY]
|
||||||
# if len(links_to_validate) > 15:
|
# if len(links_to_validate) > 15:
|
||||||
# return [FR_PROXY_RES_OXY, FR_PROXY_MOB_OXY, FR_PROXY_ASOCK_RES_2, FR_DATA_IMPULSE_RES]
|
# 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]
|
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:
|
def get_proxy_for_appointment_request(self) -> dict:
|
||||||
return self.get_random_sticky_iproyal_proxy()
|
# return self.get_random_sticky_iproyal_proxy()
|
||||||
# _chosen_proxy = random.choice(MOBILE_PROXY_LIST)
|
_chosen_proxy = random.choice(MOBILE_PROXY_LIST)
|
||||||
# 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(900000000, 995869818)
|
_port = random.randint(900000000, 995869818)
|
||||||
# elif "anyip" in _chosen_proxy["http"]:
|
elif "anyip" in _chosen_proxy["http"]:
|
||||||
# self.logger.info("use anyip proxy")
|
self.logger.info("use anyip proxy")
|
||||||
# _port = random.randint(40001, 49999)
|
_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)
|
||||||
# self.logger.info("generated port is {}".format(_port))
|
self.logger.info("generated port is {}".format(_port))
|
||||||
# _proxy_to_use = {}
|
_proxy_to_use = {}
|
||||||
# _proxy_to_use["http"] = _chosen_proxy["http"].format(_port)
|
_proxy_to_use["http"] = _chosen_proxy["http"].format(_port)
|
||||||
# _proxy_to_use["https"] = _chosen_proxy["https"].format(_port)
|
_proxy_to_use["https"] = _chosen_proxy["https"].format(_port)
|
||||||
# return _proxy_to_use
|
return _proxy_to_use
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
_logger = logging.getLogger()
|
_logger = logging.getLogger()
|
||||||
_proxy = ProxyManager(logger=_logger)
|
_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)
|
print(_proxise)
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"https://ip.oxylabs.io/location",
|
"https://ip.oxylabs.io/location",
|
||||||
|
|||||||
Reference in New Issue
Block a user