def getCountryId(country_name: str) -> str or None: """ Reads file `./data/countrydata.json` and returns a value matched with `country_name` Arguments: country_name {str} -- Name of the country you want to get the ID for Returns: str -- ID of the country (if found) None -- if not found """ if os.stat("./data/countrydata.json").st_size == 0: scrapeCountryIds( { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "accept-encoding": "gzip, deflate, br", "accept-language": "en-GB,en-US;q=0.9,en;q=0.8,cs;q=0.7,de;q=0.6", # 'cache-control': 'max-age=0', # 'sec-fetch-mode': 'navigate', # 'sec-fetch-site': 'none', "referer": "https://www.google.com/", # 'sec-fetch-user': '******', # 'origin': 'https://www.solebox.com', # 'upgrade-insecure-requests': '1', "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", } ) country_data = readFile("./data/countrydata.json") try: country_id = country_data[country_name] return country_id except: logMessage( "ERROR", "Error getting country_id, check your country name in userdata.json!", ) return None
def start(): print(Style.BRIGHT + Fore.CYAN + "Welcome to BONZAY Tools™!") print(Fore.LIGHTYELLOW_EX + "Please select an option:") print(Fore.LIGHTYELLOW_EX + "[1] - Generate Solebox accounts (with a shipping address)") print(Fore.LIGHTYELLOW_EX + "[2] - Generate Solebox accounts (with " + Style.BRIGHT + Fore.LIGHTYELLOW_EX + "NO shipping address" + Style.NORMAL + Fore.LIGHTYELLOW_EX + ")") print(Fore.LIGHTYELLOW_EX + "[3] - Check Solebox accounts' shipping addresses") print(Fore.LIGHTYELLOW_EX + "[4] - Check valid Solebox accounts") print("------") # ----- Get input (which option) ----- # while (1): option = input() try: option = int(option) if type(option) is int and option in range(1, 5): break else: print( f"{option} is not a valid option. Try again with a number from 1 to 4:" ) except: print("Not an integer. Try again:") # ---------------------------------------- [1] - Solebox Account Generator (with a shipping address) ---------------------------------------- # if option == 1: # print("\n"*100) print(Style.BRIGHT + Fore.CYAN + "SOLEBOX ACCOUNT GENERATOR") # ----- Get input (how many accs to generate) ----- # how_many = None while (1): try: how_many = int( input("How many accounts would you like to create?\n")) except ValueError: print("That is not an integer. Try again...") if type(how_many) == int: break print(Style.BRIGHT + "Starting to generate Solebox accounts...") threads = [] for _ in range(how_many): t = threading.Thread(target=SoleboxGenerateAccount) threads.append(t) t.start() time.sleep(random.randint(1, 3)) for t in threads: t.join() print("\nFinished generating Solebox accounts.") print(Style.BRIGHT + f"\nGenerated {SUCCESS_COUNT}/{how_many} accounts!") # ---------------------------------------- [1] - Solebox Account Generator (with NO shipping address) ---------------------------------------- # if option == 2: # print("\n"*100) print(Style.BRIGHT + Fore.CYAN + "SOLEBOX ACCOUNT GENERATOR") # ----- Get input (how many accs to generate) ----- # how_many = None while (1): try: how_many = int( input("How many accounts would you like to create?\n")) except ValueError: print("That is not an integer. Try again...") if type(how_many) == int: break print(Style.BRIGHT + "Starting to generate Solebox accounts...") threads = [] for _ in range(how_many): t = threading.Thread(target=SoleboxGenerateAccountNoShipping) threads.append(t) t.start() time.sleep(random.randint(1, 3)) for t in threads: t.join() print("\nFinished generating Solebox accounts.") print(Style.BRIGHT + f"\nGenerated {SUCCESS_COUNT}/{how_many} accounts!") # ---------------------------------------- [3] - Solebox Shipping Address Checker ---------------------------------------- # elif option == 3: print(Style.BRIGHT + Fore.CYAN + "SOLEBOX SHIPPING ADDRESS CHECKER") # ----- Load all accounts with shipping ----- # print("Loading accounts from solebox-valid.txt") f = readFile("./accounts/solebox-valid.txt") accounts = f.split('\n') print(Style.BRIGHT + "Starting to check Solebox account's shipping addresses.") # ----- Create one thread for each account ----- # threads = [] for account in accounts: if account.strip() == '': continue username, password = account.split(':') t = threading.Thread(target=SoleboxCheckShippingAddress, args=(username, password)) threads.append(t) t.start() time.sleep(random.randint(1, 3)) for t in threads: t.join() print(Style.BRIGHT + "\nFinished checking Solebox account's shipping addresses.") # ---------------------------------------- [4] - Solebox Valid Account Checker ---------------------------------------- # elif option == 4: print(Style.BRIGHT + Fore.CYAN + "SOLEBOX VALID ACCOUNT CHECKER") # ----- Load all accounts with shipping ----- # print("Loading accounts from solebox-valid.txt") f = readFile("./accounts/solebox-valid.txt") accounts = f.split('\n') print(Style.BRIGHT + "Starting to check valid Solebox accounts...") # ----- Create one thread for each account ----- # threads = [] for account in accounts: if account.strip() == '': continue # check if there's no newline in password username, password = account.split(':') t = threading.Thread(target=SoleboxCheckAccount, args=(username, password)) threads.append(t) t.start() time.sleep(random.randint(1, 3)) for t in threads: t.join() print(Style.BRIGHT + "\nFinished checking Solebox accounts.")
def __init__(self, proxy_list): # ---------- General ---------- # self.proxy_list = proxy_list useragents = loadUseragents() # ---------- Generation Type ---------- # self.useragent_type = random.choice(["mobile", "desktop"]) if self.useragent_type == "mobile": mobile = True ua = random.choice(useragents[1]) else: mobile = False ua = random.choice(useragents[0]) # ---------- Headers ---------- # SOLEBOX_URLS = [ "https://www.solebox.com/en/Apparel/", "https://www.solebox.com/", "https://www.solebox.com/en/New/", "https://www.solebox.com/en/Soon/", "https://www.solebox.com/en/Footwear/", "https://www.solebox.com/en/Accessories/", "https://www.solebox.com/index.php?lang=1&cl=brands", "https://www.solebox.com/en/Sale/", "https://www.solebox.com/blog/", "https://www.solebox.com/en/cart/", ] # ---------- Creating a session ---------- # self.s = cloudscraper.create_scraper(browser={ 'browser': 'chrome', 'mobile': mobile }) self.s.headers.update({ "cache-control": "max-age=0", "upgrade-insecure-requests": "1", "user-agent": ua, "sec-fetch-user": "******", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "sec-fetch-site": "same-origin", "sec-fetch-mode": "navigate", "referer": random.choice(SOLEBOX_URLS), "accept-encoding": "gzip, deflate, br", "accept-language": "en-GB,en-US;q=0.9,en;q=0.8,cs;q=0.7,de;q=0.6", }) self.stoken = None # ---------- Loading user input data ---------- # config = readFile("./userdata.json") userdata = config["profile"] self.settings = config["settings"] self.first_name = userdata["first_name"] self.last_name = userdata["last_name"] self.phone_num = userdata["phone_num"] self.catchall = userdata["catchall"] if self.catchall.strip() == '': self.catchall = "gmail.com" if '@' in self.catchall: self.catchall = self.catchall.replace('@', '') self.passwd = userdata["passwd"] self.address_first_line = userdata["address_first_line"] self.house_number = userdata["house_number"] self.address_second_line = userdata["address_second_line"] self.zipcode = userdata["zipcode"] self.city = userdata["city"] self.country_name = userdata["country_name"] self.us_state = userdata["us_state"] self.webhook_url = userdata["webhook_url"] # ---------- Loading data ---------- # self.country_id = getCountryId(self.country_name) if self.country_id == None: quit() # ---------- Jigging info ---------- # self.jigInfo()
def __init__(self, proxy_list): """Constructor for the `SoleboxGen` class Arguments: proxy_list {list} -- list of proxies """ # ---------- General ---------- # self.proxy_list = proxy_list useragents = loadUseragents() # ---------- Generation Type ---------- # self.useragent_type = random.choice(["mobile", "desktop"]) if self.useragent_type == "mobile": mobile = True ua = random.choice(useragents[1]) else: mobile = False ua = random.choice(useragents[0]) # ---------- Headers ---------- # # SOLEBOX_URLS = [ # "https://www.solebox.com/en/Apparel/", # "https://www.solebox.com/", # "https://www.solebox.com/en/New/", # "https://www.solebox.com/en/Soon/", # "https://www.solebox.com/en/Footwear/", # "https://www.solebox.com/en/Accessories/", # "https://www.solebox.com/index.php?lang=1&cl=brands", # "https://www.solebox.com/en/Sale/", # "https://www.solebox.com/blog/", # "https://www.solebox.com/en/cart/", # ] # ---------- Creating a session ---------- # self.s = cloudscraper.create_scraper( browser={"browser": "chrome", "mobile": mobile}, ) self.s.headers.update( { # "cache-control".title(): "max-age=0", "upgrade-insecure-requests".title(): "1", "pragma".title(): "no-cache", # "content-type".title(): "application/x-www-form-urlencoded", "user-agent".title(): ua, "sec-fetch-dest".title(): "document", "accept".title(): "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", # "sec-fetch-site".title(): "same-origin", # "sec-fetch-mode".title(): "navigate", # "sec-fetch-user".title(): "?1", "accept-encoding".title(): "gzip, deflate, br", "accept-language".title(): "en-GB,en-US;q=0.9,en;q=0.8,cs;q=0.7,de;q=0.6", } ) self.stoken = None # ---------- Loading user input data ---------- # config = readFile("./userdata.json") userdata = config["profile"] self.settings = config["settings"] self.jig_settings = config["advanced_jigging"] if self.jig_settings["max_num_of_random_numbers_behing_email"] > 10: logMessage( "Critical", "Make sure the max_num_of_random_numbers_behing_email in userdata.json is set to less than 10!", ) exit() self.first_name = userdata["first_name"] self.last_name = userdata["last_name"] self.phone_num = userdata["phone_num"] self.catchall = userdata["catchall"] if self.catchall.strip() == "": self.catchall = "gmail.com" if "@" in self.catchall: self.catchall = self.catchall.replace("@", "") self.passwd = userdata["passwd"] self.address_first_line = userdata["address_first_line"] self.house_number = userdata["house_number"] self.address_second_line = userdata["address_second_line"] self.zipcode = userdata["zipcode"] self.city = userdata["city"] self.country_name = userdata["country_name"] self.us_state = userdata["us_state"] self.webhook_url = userdata["webhook_url"] # ---------- Loading data ---------- # self.country_id = getCountryId(self.country_name) if self.country_id == None: quit() # ---------- Jigging info ---------- # self.jigInfo()