update oxy sticky credentiels
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
|
import logging
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
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',
|
||||||
@@ -25,8 +28,8 @@ FR_PROXY_ASOCK_RES_2 = {
|
|||||||
'https': 'http://zd6fbrujot-res-country-FR-hold-query:8k8avNlnLHQaMsWg@217.23.6.161:9999'
|
'https': 'http://zd6fbrujot-res-country-FR-hold-query:8k8avNlnLHQaMsWg@217.23.6.161:9999'
|
||||||
}
|
}
|
||||||
FR_PROXY_MOB_OXY_STICKY = {
|
FR_PROXY_MOB_OXY_STICKY = {
|
||||||
'http': 'http://customer-rendezvousmob-cc-FR:Rdv202220212023@fr-pr.oxylabs.io:{}',
|
'http': 'http://customer-rendezvousmob-cc-fr-sessid-0{}-sesstime-2:Rdv+202220212023@pr.oxylabs.io:7777',
|
||||||
'https': 'http://customer-rendezvousmob-cc-FR:Rdv202220212023@fr-pr.oxylabs.io:{}'
|
'https': 'http://customer-rendezvousmob-cc-fr-sessid-0{}-sesstime-2:Rdv+202220212023@pr.oxylabs.io:7777'
|
||||||
}
|
}
|
||||||
|
|
||||||
FR_PROXY_DATA_IMPULSE_STICKY = {
|
FR_PROXY_DATA_IMPULSE_STICKY = {
|
||||||
@@ -59,12 +62,11 @@ FR_MOBILE_ANY_IP_ROTATING = {
|
|||||||
# FR_PROXY_DATA_IMPULSE_STICKY]
|
# FR_PROXY_DATA_IMPULSE_STICKY]
|
||||||
|
|
||||||
|
|
||||||
|
# MOBILE_PROXY_LIST = [FR_MOBILE_ANY_IP_STICKY, FR_PROXY_MOB_OXY_STICKY]
|
||||||
|
# MOBILE_PROXY_LIST = [FR_PROXY_MOB_OXY_STICKY]
|
||||||
MOBILE_PROXY_LIST = [FR_MOBILE_ANY_IP_STICKY]
|
MOBILE_PROXY_LIST = [FR_MOBILE_ANY_IP_STICKY]
|
||||||
|
|
||||||
|
|
||||||
# MOBILE_PROXY_LIST = [FR_MOBILE_ANY_IP_STICKY]
|
|
||||||
|
|
||||||
|
|
||||||
class ProxyManager:
|
class ProxyManager:
|
||||||
|
|
||||||
def __init__(self, logger):
|
def __init__(self, logger):
|
||||||
@@ -72,7 +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_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]
|
||||||
# # 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]
|
||||||
@@ -88,7 +91,7 @@ class ProxyManager:
|
|||||||
_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(40001, 49999)
|
_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)
|
||||||
@@ -100,3 +103,14 @@ class ProxyManager:
|
|||||||
_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__':
|
||||||
|
_logger = logging.getLogger()
|
||||||
|
_proxy = ProxyManager(logger=_logger)
|
||||||
|
_proxise = _proxy.get_proxy_for_appointment_request()
|
||||||
|
print(_proxise)
|
||||||
|
response = requests.get(
|
||||||
|
"https://ip.oxylabs.io/location",
|
||||||
|
proxies=_proxise)
|
||||||
|
print(response.content)
|
||||||
|
|||||||
Reference in New Issue
Block a user