import random import string import definitions from db.DbManager import DataManager from db.local_db_manager import LocalDbManager from db.mongo_manager import MongoDbManager from logs.LogSender import LogSender from proxy.proxy_type import ProxyType firebase_store_manager = DataManager() oracle_log_sender = LogSender() # proxy PROXY_SERVER = "http://gw.ntnt.io:5959" PROXY_PASSWORD = "94sY7zwBG13i" BRIGHT_DATA_PROXY_SERVER = "http://zproxy.lum-superproxy.io:22225" BRIGHT_DATA_PROXY_USERNAME = "lum-customer-c_daabba94-zone-residential-country-fr" BRIGHT_DATA_MOBILE_PROXY_USERNAME = "lum-customer-c_daabba94-zone-mobile-country-fr-city-paris-mobile" BRIGHT_DATA_PROXY_PASSWORD = "9dwmh54u3bbh" BRIGHT_DATA_MOBILE_PROXY_PASSWORD = "fk5f7c2z2c19" PROXY_NAME_PREFIX_RES = "panleicim-res-fr-" PROXY_NAME_PREFIX_CC = "panleicim-cc-fr-" mongo_store_manager = MongoDbManager() def get_proxy_name_prefix() -> str: return PROXY_NAME_PREFIX_RES def get_proxy(proxy_type: ProxyType): if proxy_type == ProxyType.NETNUT: random_id_number = get_random_id_number_for_proxy() proxy_username = get_proxy_name_prefix() + random_id_number proxy = { "server": PROXY_SERVER, "username": proxy_username, "password": PROXY_PASSWORD } else: proxy = { "server": BRIGHT_DATA_PROXY_SERVER, "username": BRIGHT_DATA_PROXY_USERNAME, "password": BRIGHT_DATA_PROXY_PASSWORD } return proxy def get_random_id_number_for_proxy() -> str: S = 8 # number of characters in the string. ran = ''.join(random.choices(string.digits, k=S)) id_number = str(ran) print("The randomly generated string is : " + str(ran)) # print the random data return id_number local_db_manager = LocalDbManager(definitions.home) DEVICES = ['iPad (gen 6)', 'iPad (gen 6) landscape', 'iPad (gen 7)', 'iPad (gen 7) landscape', 'iPad Mini', 'iPad Mini landscape', 'iPad Pro 11', 'iPad Pro 11 landscape', 'iPhone 6', 'iPhone 6 landscape', 'iPhone 6 Plus', 'iPhone 6 Plus landscape', 'iPhone 7', 'iPhone 7 landscape', 'iPhone 7 Plus', 'iPhone 7 Plus landscape', 'iPhone 8', 'iPhone 8 landscape', 'iPhone 8 Plus', 'iPhone 8 Plus landscape', 'iPhone SE', 'iPhone SE landscape', 'iPhone X', 'iPhone X landscape', 'iPhone XR', 'iPhone XR landscape', 'iPhone 11', 'iPhone 11 landscape', 'iPhone 11 Pro', 'iPhone 11 Pro landscape', 'iPhone 11 Pro Max', 'iPhone 11 Pro Max landscape', 'iPhone 12', 'iPhone 12 landscape', 'iPhone 12 Pro', 'iPhone 12 Pro landscape', 'iPhone 12 Pro Max', 'iPhone 12 Pro Max landscape', 'iPhone 12 Mini', 'iPhone 13', 'iPhone 13 landscape', 'iPhone 13 Pro', 'iPhone 13 Pro landscape', 'iPhone 13 Pro Max', 'iPhone 13 Mini']