Skip to content

Commit

Permalink
Urgent launcher bug fix + Chess.com checker
Browse files Browse the repository at this point in the history
Fixed launcher's checker index being messed up by __pycache__ for good. Added Chess.com username checker
  • Loading branch information
mov-ebx committed Dec 24, 2022
1 parent 6726fd1 commit 5927a91
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2
0.3
3 changes: 2 additions & 1 deletion data/checkers.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"GitHub.py":"0.1",
"Replit.py":"0.2",
"Roblox.py":"0.2",
"Twitter.py":"0.2"
"Twitter.py":"0.2",
"Chess-com.py":"0.3"
}
41 changes: 41 additions & 0 deletions src/checkers/Chess-com.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

import requests, random

def run(usernames:str, proxies_path:str):
use_proxies = False if proxies_path == "" else True
usernames = open(usernames)
if use_proxies:
proxies = open(proxies_path)
continue_with = None
if use_proxies:
proxies_list = proxies.readlines()
valid = []
status = 404
for username in usernames:
username = username.strip('\n')
this_use_proxies = use_proxies
url = "https://chess.com/member/"+username.lower()
try:
if use_proxies:
proxy = proxies_list[random.randint(0, len(proxies_list)-1)]
proxy = {proxy.split('|')[0]:proxy.split('|')[1].strip('\n')}
except:
if continue_with == None:
print("Failed to load a proxy. Perhaps your proxies.txt is empty?")
continue_with = False if input("Continue with proxies? (y/N): ").lower().startswith("n") else True
this_use_proxies = False
if continue_with == False:
continue
elif this_use_proxies:
r = requests.get(url, proxies=proxy)
if r.status_code == status:
valid.append(username)
else:
r = requests.get(url)
if r.status_code == status:
valid.append(username+'\n')
open('hits.txt','w').writelines(valid)
print('\nSaved valid usernames to hits.txt')
usernames.close()
if use_proxies:
proxies.close()
11 changes: 6 additions & 5 deletions src/launcher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def download_presets():

# Command line
checkers = os.listdir(DIR+'/checkers/')
checkers = [f for f in checkers if f.endswith('py')]
presets = os.listdir(DIR+'/presets/')
print("Commands:\n - help\n - exit\n - clear\n - checkers\n - run [id]\n")
while True:
Expand All @@ -95,9 +96,8 @@ def download_presets():
print('\ncheckers:')
i = 1
for checker in checkers:
if checker.endswith('.py'):
print(f' {i}) {checker[:-3]}')
i += 1
print(f' {i}) {checker[:-3].replace("-",".").replace("_"," ")}')
i += 1
print("")
elif command == 'exit':
exit(0)
Expand All @@ -107,7 +107,7 @@ def download_presets():
title()
elif command == 'run':
try:
checker = checkers[int(args)]
checker = checkers[int(args)-1]
print(f'\nSelected {checker}\n')
print("Select your username list:\n")
i = 1
Expand Down Expand Up @@ -136,7 +136,8 @@ def download_presets():
print("\nRunning "+checker[:-3]+"...")
__import__('checkers.'+checker[:-3], fromlist=[None]).run(usernames=username_path, proxies_path=proxies_path)
print("\nDone!\n")
except:
except Exception as e:
print(e)
print("\nFailed.\n")
except:
print("\n\nGoodbye!")
Expand Down

0 comments on commit 5927a91

Please sign in to comment.