Skip to content

Commit

Permalink
Colour + bug fixes + removed broken checkers
Browse files Browse the repository at this point in the history
  • Loading branch information
ghluka committed Nov 3, 2024
1 parent ea4aff9 commit 4c81ee3
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 133 deletions.
37 changes: 0 additions & 37 deletions src/checkers/beacons-ai.py

This file was deleted.

25 changes: 0 additions & 25 deletions src/checkers/gitlab.py

This file was deleted.

28 changes: 0 additions & 28 deletions src/checkers/instagram.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/checkers/lichess.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def _(self, username:str, proxies:str="") -> str|None:
if r.status_code == 429:
time.sleep(self.RATELIMIT_TIMEOUT)

return username if r.json() is False else None
return username if r.text == "false" else None
2 changes: 1 addition & 1 deletion src/checkers/roblox.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ def _(self, username:str, proxies:str="") -> str|None:
if r.status_code == 429:
time.sleep(self.RATELIMIT_TIMEOUT)

return username if r.json()['code'] == 0 else None
return username if r.json().get('code') == 0 else None
28 changes: 0 additions & 28 deletions src/checkers/x.py

This file was deleted.

14 changes: 8 additions & 6 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import pathlib
import time

from colorama import Fore

from utils.checkers import get_checker, path
from utils.output import clear, title
from utils.prompts import bool_input, select_checker, select_file
Expand All @@ -19,20 +21,20 @@ def main():
try:
# Service selector
checker_name = select_checker()
print(f"\nSelected {checker_name.capitalize()}.")
print(f"\nSelected {Fore.CYAN}{checker_name.capitalize()}{Fore.RESET}.")
checker = get_checker(checker_name)

# Username list selector
print("\nSelect your usernames list.")
print(f"\n{Fore.BLUE}>{Fore.RESET} Select your usernames list.")
usernames = select_file()
print(f"Selected {len(usernames)} usernames from list.")
print(f"Selected {Fore.CYAN}{len(usernames)}{Fore.RESET} usernames from list.")

# Proxy selector
proxies = []
if bool_input("\nUse proxies?", False):
print("Select your proxy list.")
print(f"{Fore.BLUE}>{Fore.RESET} Select your proxy list.")
proxies = select_file()
print(f"Loaded {len(proxies)} proxies.")
print(f"Loaded {Fore.CYAN}{len(proxies)}{Fore.RESET} proxies.")

# Get hits
print("\nStarting...")
Expand All @@ -44,7 +46,7 @@ def main():
hits.remove(None)

elapsed = time.perf_counter() - start
print(f"Done! Took {elapsed:.2f}s")
print(f"{Fore.CYAN}Done!{Fore.RESET} Took {elapsed:.2f}s")

# Save hits
pathlib.Path(f"{path}/hits").mkdir(exist_ok=True)
Expand Down
3 changes: 2 additions & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
httpx
httpx
colorama
13 changes: 12 additions & 1 deletion src/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""
import os

from colorama import Fore


def clear() -> None:
"""Clears screen"""
Expand All @@ -11,12 +13,15 @@ def clear() -> None:
def title() -> None:
"""Outputs title as ASCII art"""
print(
Fore.CYAN + \
" ██ ██ █████ ██████ \n" \
" ██ ██ ██ ██ ██ \n" \
" ██ ██ ███████ ██ \n" \
" ██ ██ ██ ██ ██ \n" \
" ██████ ██ ██ ██████ \n" \
"Username Availability Checker" + "\n"
+ Fore.BLUE + \
"Username Availability Checker" + "\n" \
+ Fore.RESET
)


Expand All @@ -30,3 +35,9 @@ def print_columns(values:list, columns:int=3, start:str="", end:str="\n") -> Non
out += f"\n{start}" if i % columns == 0 else " "

print(out, end=end)


if __name__ == "__main__":
clear()
title()
print_columns(["a", "b", "c", "d", "e", "F", "g", "H"])
13 changes: 9 additions & 4 deletions src/utils/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import tkinter as tk
from tkinter import filedialog

from colorama import Fore

from utils.checkers import get_checkers, path
from utils.output import print_columns

Expand All @@ -17,10 +19,10 @@ def select_checker() -> str:
print(f"Checkers ({len(checkers)}):")
print_columns(checkers, start=" ", end="\n")

name = input("Which checker do you want to use: ")
name = input(f"{Fore.BLUE}>{Fore.RESET} Which checker do you want to use: ")
while name.capitalize() not in checkers:
print(" Invalid checker! Try again.\n")
name = input("Which checker do you want to use: ")
print(f"{Fore.RED}Invalid checker! Try again.{Fore.RESET}\n")
name = input(f"{Fore.BLUE}>{Fore.RESET} Which checker do you want to use: ")

return name

Expand All @@ -42,7 +44,10 @@ def select_file() -> str:

def bool_input(input_prompt:str, default:bool=True) -> bool:
"""Prompts user for a bool."""
input_str:str = input(input_prompt + f" ({'Y/n' if default else 'y/N'}): ")
input_str = "\n" if input_prompt.startswith("\n") else ""
input_prompt = input_prompt.lstrip("\n")
input_str += f"{Fore.BLUE}>{Fore.RESET} {input_prompt} ({'Y/n' if default else 'y/N'}): "
input_str = input(input_str)

if input_str.lower().startswith("y"):
return True
Expand Down
3 changes: 2 additions & 1 deletion src/utils/proxies.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Proxy utils.
"""
import httpx
from colorama import Fore


def test_proxy(proxy:str) -> bool:
Expand All @@ -23,7 +24,7 @@ def get_proxy(proxies:list) -> dict:
if test_proxy(proxy):
return {"http://":f"{proxy}", "https://":f"{proxy}"}

print("No valid proxy in your provided list! Make sure you're using HTTP proxies and not SOCK5.")
print(f"{Fore.RED}No valid proxy in your provided list! Make sure you're using HTTP proxies and not SOCK5.{Fore.RESET}")
exit(1)


Expand Down

0 comments on commit 4c81ee3

Please sign in to comment.