use iproyal proxies

This commit is contained in:
2025-11-11 11:21:02 +01:00
parent cd0f0ebebc
commit 04fbf87490
4 changed files with 4032 additions and 26 deletions
+30 -22
View File
@@ -3,6 +3,8 @@ import random
import requests import requests
from utils.iproayl_stick_proxy_list import FR_IPROYAL_STICKY_PROXY_LIST
FR_ASOCKS_MOBILE_PROXY = { FR_ASOCKS_MOBILE_PROXY = {
'http': 'http://11797317-mobile-country-FR:nv958134x@190.2.151.110:14046', 'http': 'http://11797317-mobile-country-FR:nv958134x@190.2.151.110:14046',
'https': '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', 'http': 'http://Uv2qfG3PyhT6Wctw:V45HOlzAIssCYssJ_country-fr@geo.iproyal.com:12321',
'https': '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] # 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, FR_PROXY_MOB_OXY, FR_PROXY_ASOCK_RES_2, FR_DATA_IMPULSE_RES]
# return [FR_PROXY_RES_OXY] # 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): def get_result_link_proxy(self):
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:
_chosen_proxy = random.choice(MOBILE_PROXY_LIST) return self.get_random_sticky_iproyal_proxy()
if "oxylabs" in _chosen_proxy["http"]: # _chosen_proxy = random.choice(MOBILE_PROXY_LIST)
self.logger.info("use oxylabs proxy") # if "oxylabs" in _chosen_proxy["http"]:
_port = random.randint(900000000, 995869818) # self.logger.info("use oxylabs proxy")
elif "anyip" in _chosen_proxy["http"]: # _port = random.randint(900000000, 995869818)
self.logger.info("use anyip proxy") # elif "anyip" in _chosen_proxy["http"]:
_port = random.randint(40001, 49999) # self.logger.info("use anyip proxy")
else: # _port = random.randint(40001, 49999)
self.logger.info("use dataimpulse proxy") # else:
_port = random.randint(10000, 20000) # self.logger.info("use dataimpulse proxy")
self.logger.info("generated port is {}".format(_port)) # _port = random.randint(10000, 20000)
_proxy_to_use = {} # self.logger.info("generated port is {}".format(_port))
_proxy_to_use["http"] = _chosen_proxy["http"].format(_port) # _proxy_to_use = {}
_proxy_to_use["https"] = _chosen_proxy["https"].format(_port) # _proxy_to_use["http"] = _chosen_proxy["http"].format(_port)
return _proxy_to_use # _proxy_to_use["https"] = _chosen_proxy["https"].format(_port)
# 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_proxy_for_appointment_request() _proxise = _proxy.get_random_sticky_iproyal_proxy()
print(_proxise) print(_proxise)
response = requests.get( response = requests.get(
"https://ip.oxylabs.io/location", "https://ip.oxylabs.io/location",
-4
View File
@@ -100,13 +100,9 @@ if __name__ == '__main__':
# file_list = ['~/Desktop/contact_list_2024-05-23.xlsx', # file_list = ['~/Desktop/contact_list_2024-05-23.xlsx',
# '~/Desktop/contact_list_2024-05-21.xlsx', # '~/Desktop/contact_list_2024-05-21.xlsx',
# '~/Desktop/15_05_to_test.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_2025-10-30.xlsx']
# file_list = ['~/Desktop/contact_list_all.xlsx'] # file_list = ['~/Desktop/contact_list_all.xlsx']
# file_list = ['~/Desktop/contact_list_2025-09-08.xlsx'] # file_list = ['~/Desktop/contact_list_2025-09-08.xlsx']
# file_list = ['~/Desktop/real_name_contacts_100_aol_17_04.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, 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) data_queue_name=MORNING_DATA_CACHE, stop_at_hour=19, stop_at_mins=50)
File diff suppressed because it is too large Load Diff
+2
View File
@@ -56,6 +56,8 @@ class Sender:
result.proxy = "oxylabs_res" result.proxy = "oxylabs_res"
elif "anyip" in self.proxy_to_use["http"]: elif "anyip" in self.proxy_to_use["http"]:
result.proxy = "anyip" result.proxy = "anyip"
elif "iproyal" in self.proxy_to_use["http"]:
result.proxy = "iproyal"
else: else:
result.proxy = "data_impulse" result.proxy = "data_impulse"
result.id = id result.id = id