-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
69 lines (58 loc) · 2.35 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import requests, random, string, json, time, threading
url = "https://prod-api-funimationnow.dadcdigital.com/api/auth/register/"
def random(length=8):
characters = string.ascii_letters + string.digits
return "".join(random.choice(characters) for _ in range(length))
def email():
return f"{random()}@heroin.gg"
def password():
return f"{random()}1!"
def register_account():
A = "x-csrftoken"
while True:
try:
random_email = email()
random_password = password()
options_headers = {
"Access-Control-Request-Headers": "territory,x-csrftoken",
"Access-Control-Request-Method": "POST",
"Connection": "keep-alive",
}
options_response = requests.options(url, headers=options_headers)
csrf_token = options_response.headers.get(A)
if options_response.status_code == 200:
headers = {
"devicetype": "Android Phone",
"User-Agent": "okhttp/3.12.1",
A: csrf_token,
}
body = {"email": random_email, "password": random_password}
post_response = requests.post(url, headers=headers, data=body)
if post_response.status_code == 200:
response_data = post_response.json()
user_id = response_data["user"]["id"]
auth_token = response_data["token"]
with open("login.txt", "a") as file:
file.write(
f"{random_email}:{random_password}:{user_id}:{auth_token}\n"
)
print(f"Successfully registered: {email}")
else:
print(
f"Registration failed for {email} with status code {post_response.status_code}"
)
else:
print(
f"OPTIONS request failed with status code {options_response.status_code}"
)
except Exception as e:
print(f"An error occurred: {e}")
num_threads = 7
threads = []
for _ in range(num_threads):
thread = threading.Thread(target=register_account)
thread.start()
threads.append(thread)
for thread in threads:
thread.join()
print("Registration completed.")