-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathminecraft.py
77 lines (65 loc) · 1.84 KB
/
minecraft.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
70
71
72
73
74
75
from multiprocessing import Pool, Process, freeze_support, set_start_method, get_context
from multiprocessing import set_start_method
from requests.packages.urllib3.util.retry import Retry
import requests
import time
from proxy import getWorkingProxy
requests.packages.urllib3.disable_warnings()
"""
This code is licensed under QPL-1.0.
You CAN:
- Distribute
- Modify
You CANNOT:
- Commercial Use
You MUST:
- Include copyright
- Include license
- Disclose source
Source code can be found here:
https://git.landon.pw/r/social-checker
"""
def main():
set_start_method("spawn")
print("Checking Minecraft names... Proxies needed.")
filename = input("What is the filename?: ")
usernames = open(f"wordlist/{filename}")
pool = Pool(processes=100)
lines = usernames.readlines()
start = time.time()
pool.map(request, lines)
ttl = time.time() - start
rps = len(lines) / ttl
print(f"Checking is completed.")
print(f"Took {ttl} seconds to check.")
print(f"{rps} names checked/second.")
def request(line):
proxy = getWorkingProxy()
proxies = {
"http": "http://" + proxy
}
url = "https://account.mojang.com/available/minecraft/"
user = line.strip()
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"
}
try:
r = requests.get(url + user, headers=headers, proxies=proxies, verify=False)
status = r.text
print(r.url + proxy)
if ("AVAILABLE" in status):
print(f"{user} is available.")
file = open("available.txt", "a")
file.write("https://namemc.com/" + user + "\n")
file.close()
elif ("TAKEN" in status):
print(f"{user} is taken.")
else:
print(f"Connection Error: {user}. Retrying.")
request(user)
except Exception as e:
print(f"Connection Error: {user}. Retrying.")
request(user)
if __name__ == '__main__':
freeze_support()
main()