use iproyal proxies
This commit is contained in:
@@ -3,6 +3,8 @@ import random
|
||||
|
||||
import requests
|
||||
|
||||
from utils.iproayl_stick_proxy_list import FR_IPROYAL_STICKY_PROXY_LIST
|
||||
|
||||
FR_ASOCKS_MOBILE_PROXY = {
|
||||
'http': 'http://11797317-mobile-country-FR:nv958134x@190.2.151.110:14046',
|
||||
'https': 'http://11797317-mobile-country-FR:nv958134x@190.2.151.110:14046',
|
||||
@@ -58,12 +60,6 @@ FR_RES_IP_ROYAL_ROTATING = {
|
||||
'http': 'http://Uv2qfG3PyhT6Wctw:V45HOlzAIssCYssJ_country-fr@geo.iproyal.com:12321',
|
||||
'https': 'http://Uv2qfG3PyhT6Wctw:V45HOlzAIssCYssJ_country-fr@geo.iproyal.com:12321',
|
||||
}
|
||||
# 八分之一用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_MOBILE_ANY_IP_STICKY, FR_MOBILE_ANY_IP_STICKY, FR_MOBILE_ANY_IP_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, FR_PROXY_MOB_OXY_STICKY]
|
||||
@@ -89,31 +85,43 @@ class ProxyManager:
|
||||
# return [FR_PROXY_RES_OXY, FR_PROXY_MOB_OXY, FR_PROXY_ASOCK_RES_2, FR_DATA_IMPULSE_RES]
|
||||
# return [FR_PROXY_RES_OXY]
|
||||
|
||||
def get_random_sticky_iproyal_proxy(self) -> dict:
|
||||
_session_info = random.choice(FR_IPROYAL_STICKY_PROXY_LIST)
|
||||
_proxy_template = {
|
||||
'http': 'http://{}@geo.iproyal.com:12321',
|
||||
'https': 'http://{}@geo.iproyal.com:12321',
|
||||
}
|
||||
_proxy_to_use = {}
|
||||
_proxy_to_use["http"] = _proxy_template["http"].format(_session_info)
|
||||
_proxy_to_use["https"] = _proxy_template["https"].format(_session_info)
|
||||
return _proxy_to_use
|
||||
|
||||
def get_result_link_proxy(self):
|
||||
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:
|
||||
_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_proxy_for_appointment_request()
|
||||
_proxise = _proxy.get_random_sticky_iproyal_proxy()
|
||||
print(_proxise)
|
||||
response = requests.get(
|
||||
"https://ip.oxylabs.io/location",
|
||||
|
||||
@@ -100,13 +100,9 @@ if __name__ == '__main__':
|
||||
# file_list = ['~/Desktop/contact_list_2024-05-23.xlsx',
|
||||
# '~/Desktop/contact_list_2024-05-21.xlsx',
|
||||
# '~/Desktop/15_05_to_test.xlsx']
|
||||
# file_list = ['~/Desktop/contact_list_2025-07-15.xlsx']
|
||||
# file_list = ['~/Desktop/contact_list_2025-07-28.xlsx']
|
||||
file_list = ['~/Desktop/contact_list_2025-10-30.xlsx']
|
||||
# file_list = ['~/Desktop/contact_list_all.xlsx']
|
||||
# file_list = ['~/Desktop/contact_list_2025-09-08.xlsx']
|
||||
# file_list = ['~/Desktop/real_name_contacts_100_aol_17_04.xlsx']
|
||||
# file_list = ['~/Desktop/contact_list_2025-08-18_no_ms.xlsx']
|
||||
# file_list = ['~/Desktop/real_name_contacts_100_27_06.xlsx']
|
||||
send_request_for_file_list(file_list=file_list, thread_number=30,
|
||||
data_queue_name=MORNING_DATA_CACHE, stop_at_hour=19, stop_at_mins=50)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,6 +56,8 @@ class Sender:
|
||||
result.proxy = "oxylabs_res"
|
||||
elif "anyip" in self.proxy_to_use["http"]:
|
||||
result.proxy = "anyip"
|
||||
elif "iproyal" in self.proxy_to_use["http"]:
|
||||
result.proxy = "iproyal"
|
||||
else:
|
||||
result.proxy = "data_impulse"
|
||||
result.id = id
|
||||
|
||||
Reference in New Issue
Block a user