From 6bfcb60a569b586adef00662ff4be6f7a99f2f12 Mon Sep 17 00:00:00 2001 From: mov-ebx <120275751+mov-ebx@users.noreply.github.com> Date: Fri, 23 Dec 2022 11:33:05 -0500 Subject: [PATCH] GitHub checker --- README.md | 61 +++++++++++++++++++++++++++++++++++++++--- VERSION | 2 +- data/checkers.json | 3 ++- src/checkers/GitHub.py | 41 ++++++++++++++++++++++++++++ src/checkers/custom.py | 53 ++++++++++++++++++++++++++++++++++++ src/checkers/test.py | 10 ------- src/launcher/main.py | 10 +------ src/requirements.txt | 3 +-- 8 files changed, 157 insertions(+), 26 deletions(-) create mode 100644 src/checkers/GitHub.py create mode 100644 src/checkers/custom.py delete mode 100644 src/checkers/test.py diff --git a/README.md b/README.md index 6b54139..6ef8002 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,59 @@ -# username-checker -An open sourced username checker, built for multiple websites. Supports adding custom websites. +
+

Username checker

+ +

Collection of username checkers for various platforms

+
[WARNING]
Using this without proxies will likely leave you ratelimited and possibly banned from using any of these services.
-## the launcher is complete, however I am still yet to add the actual checkers and I also still haven't added a proper profesional readme +[![Python 3.10](https://img.shields.io/badge/Python-3.10-bluesvg)](https://www.python.org/download/releases/3.0/) +[![GitHub license](https://img.shields.io/badge/license-GPL%203.0-green)](./LICENSE) + + + +
+ +## Star goals + +5 :star: - Adding multi-threading + +10 :star: - Improve speeds + +## How do you use the checkers? + +While you can use each checker indivdually in the [checkers directory](src/checkers/), the easiest way to use the checkers, is by using the launcher. The launcher is available in the [Releases](https://github.com/mov-ebx/username-checker/releases/latest) tab. + +All you need is Python installed and the necessary [requirements](src/requirements.txt). I wrote the scripts in Python 3.10.6, so I'd recommend you [install that version](https://www.python.org/downloads/release/python-3106/). However, later versions should work too. + +## How can I integrate the checkers in my projects? + +You can easily integrate the checkers in your project, just make sure to follow the [license](LICENSE)! + +Each script has a function inside of it called "run" which can be called with the necessary parameters. + +Here's an example on how to integrate an example script in your project: + +```py +import checkers.example +example.run( + "words.txt", # usernames list path + "proxies.txt" # proxies path (leave empty if no proxies) +) +``` + +## How do I use proxies in the checker? + +In the same directory as the launcher, add a file named proxies.txt and format it like this: + +``` +type|type://host:port +``` + +an example is: + +``` +http|http://[redacted]:80 +http|http://[redacted]:9992 +http|http://[redacted]:80 +https|https://[redacted]:8080 +http|http://[redacted]:8085 +http|http://[redacted]:3128 +``` diff --git a/VERSION b/VERSION index 171538e..ceab6e1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0 \ No newline at end of file +0.1 \ No newline at end of file diff --git a/data/checkers.json b/data/checkers.json index cdc171d..686e6bc 100644 --- a/data/checkers.json +++ b/data/checkers.json @@ -1,3 +1,4 @@ { - "test.py":"0.0" + "custom.py":"0.1", + "GitHub.py":"0.1" } \ No newline at end of file diff --git a/src/checkers/GitHub.py b/src/checkers/GitHub.py new file mode 100644 index 0000000..d90f596 --- /dev/null +++ b/src/checkers/GitHub.py @@ -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://github.com/"+username + 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() diff --git a/src/checkers/custom.py b/src/checkers/custom.py new file mode 100644 index 0000000..84bf20a --- /dev/null +++ b/src/checkers/custom.py @@ -0,0 +1,53 @@ + +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 = [] + print("\nwrite {[x]} for the username if needed") + url = input("API Endpoint: ") + data = input("Data (leave empty if empty): ") + status = int(input("Status code if valid: ")) + for username in usernames: + username = username.strip('\n') + this_use_proxies = use_proxies + url = url.replace("{[x]}", username) + data = data.replace("{[x]}", username) + 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: + if data != "": + r = requests.get(url, data=data, proxies=proxy) + else: + r = requests.get(url, proxies=proxy) + if r.status_code == status: + valid.append(username) + else: + if data != "": + r = requests.get(url, data=data) + 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() diff --git a/src/checkers/test.py b/src/checkers/test.py deleted file mode 100644 index 90c0950..0000000 --- a/src/checkers/test.py +++ /dev/null @@ -1,10 +0,0 @@ - -import requests - -platform = "none" - -def run(threads:int, username_path:str, proxies_path:str): - print("test") - -if __name__ == "__main__": - run(int(input("Threads: ")), input('Usernames path: '), input('Proxies path (leave empty if none): ')) diff --git a/src/launcher/main.py b/src/launcher/main.py index 3644d66..152e122 100644 --- a/src/launcher/main.py +++ b/src/launcher/main.py @@ -133,16 +133,8 @@ def download_presets(): else: use_proxies = False proxies_path = proxies_path if use_proxies else "" - try: - threads_count = int(input("\nThreads count (default 1): ")) - if threads_count <= 0: - error('1') - except: - threads_count = 1 - print("Defaulting to 1") print("\nRunning "+checker[:-3]+"...") - #print(f"\n\nArgs (debug)\n Threads: {threads_count}\n Usernames: {username_path}\n Proxies: {proxies_path}\n") - __import__('checkers.'+checker[:-3], fromlist=[None]).run(threads_count, username_path, proxies_path) + __import__('checkers.'+checker[:-3], fromlist=[None]).run(usernames=username_path, proxies_path=proxies_path) print("\nDone!\n") except: print("\nFailed.\n") diff --git a/src/requirements.txt b/src/requirements.txt index 8213ce5..3d90aaa 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,2 +1 @@ -requests>=2.25.1 -colorama>=0.4.4 \ No newline at end of file +colorama \ No newline at end of file