(20 May, 2024 - 03:08 AM)PhantomLiar Wrote: Show MoreI hope you enjoy:
import os
import requests
import concurrent.futures
import datetime
import random
import string
import tkinter as tk
from tkinter import filedialog
def check_amazon_account(number, proxy, result_folder):
url = "https://www.amazon.com/ap/captcha"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
proxies = {
"http": proxy,
"https": proxy
}
try:
response = requests.get(url, headers=headers, proxies=proxies, timeout=10)
if response.status_code == 200:
with open(os.path.join(result_folder, 'valid.txt'), 'a') as f:
f.write(number + '\n')
print(f"[VALID] {number}")
else:
with open(os.path.join(result_folder, 'invalid.txt'), 'a') as f:
f.write(number + '\n')
print(f"[INVALID] {number}")
except Exception as e:
print(f"[ERROR] {number}: {e}")
def select_file():
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename()
return file_path
def main():
contact_file = select_file()
proxy_file = select_file()
proxy_type = input("Enter the type of proxy (HTTP/SOCKS5): ")
num_threads = int(input("Enter the number of threads: "))
folder_name = ''.join(random.choices(string.ascii_letters + string.digits, k=8))
result_folder = os.path.join('result', folder_name)
os.makedirs(result_folder)
with open(contact_file, 'r') as f:
numbers = [line.strip() for line in f.readlines()]
with open(proxy_file, 'r') as f:
proxies = [line.strip() for line in f.readlines()]
with concurrent.futures.ThreadPoolExecutor(max_workers=num_threads) as executor:
for number in numbers:
proxy_info = proxies[random.randint(0, len(proxies)-1)].split(":")
proxy = f"http://{proxy_info[0]}:{proxy_info[1]}:{proxy_info[2]}:{proxy_info[3]}@{proxy_info[4]}"
executor.submit(check_amazon_account, number, proxy, result_folder)
if __name__ == "__main__":
main()