forked from KanekiWeb/Nitro-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π¦ Release V1
- Loading branch information
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import os, requests, random, threading, json, time | ||
from colorama import Fore | ||
|
||
# Credit to Pycenter by billythegoat356 | ||
# Github: https://github.com/billythegoat356/pycenter/ | ||
# License: https://github.com/billythegoat356/pycenter/blob/main/LICENSE | ||
|
||
def center(var:str, space:int=None): # From Pycenter | ||
if not space: | ||
space = (os.get_terminal_size().columns - len(var.splitlines()[int(len(var.splitlines())/2)])) / 2 | ||
|
||
return "\n".join((' ' * int(space)) + var for var in var.splitlines()) | ||
|
||
class Console(): | ||
def ui(self): | ||
os.system(f'cls && title [DNG] Discord Nitro Generator ^| For Help join discord.gg/kaneki' if os.name == "nt" else "clear") | ||
print(center(f"""\n\n | ||
βββββββ ββββ βββ βββββββ | ||
βββββββββββββ βββββββββββ ~ Discord Nitro Generator ~ | ||
βββ βββββββββ ββββββ ββββ | ||
βββ ββββββββββββββββ βββ github.com/kanekiWeb ~ discord.gg/kaneki | ||
βββββββββββ βββββββββββββββ | ||
βββββββ βββ βββββ βββββββ \n\n | ||
""").replace('β', Fore.CYAN+"β"+Fore.RESET).replace('~', Fore.CYAN+"~"+Fore.RESET).replace('-', Fore.CYAN+"-"+Fore.RESET)) | ||
|
||
def printer(self, color, status, code): | ||
threading.Lock().acquire() | ||
print(f"{color} {status} > {Fore.RESET}discord.gift/{code}") | ||
|
||
def proxies_count(self): | ||
proxies_list = 0 | ||
with open('config/proxies.txt', 'r') as file: | ||
proxies = [line.strip() for line in file] | ||
|
||
for _ in proxies: | ||
proxies_list += 1 | ||
|
||
return int(proxies_list) | ||
|
||
|
||
class Worker(threading.Thread): | ||
def __init__(self): | ||
threading.Thread.__init__(self) | ||
|
||
def random_proxy(self): | ||
with open('config/proxies.txt', 'r') as f: | ||
proxies = [line.strip() for line in f] | ||
|
||
return random.choice(proxies) | ||
|
||
def config(self, args, args2=False): | ||
with open('config/config.json', 'r') as conf: | ||
data = json.load(conf) | ||
|
||
if args2: | ||
return data[args][args2] | ||
else: | ||
return data[args] | ||
|
||
def run(self): | ||
self.code = "".join(random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890") for _ in range(16)) | ||
try: | ||
req = requests.get(f'https://discordapp.com/api/v6/entitlements/gift-codes/{self.code}?with_application=false&with_subscription_plan=true', proxies={'http': self.config("proxies")+'://'+self.random_proxy(),'https': self.config("proxies")+'://'+self.random_proxy()}, timeout=3) | ||
|
||
if req.status_code == 200: | ||
Console().printer(Fore.LIGHTGREEN_EX, " Valid ", self.code) | ||
open('results/hit.txt', 'a+').write(self.code+"\n") | ||
try: | ||
requests.post(Worker().config("webhook", "url"), json={"content": f"||@here|| **__New Valid Nitro !!__**\n\nhttps://discord.gift/{self.code}", "username": Worker().config("webhook", "username"), "avatar_url": Worker().config("webhook", "avatar")}) | ||
except: | ||
pass | ||
elif req.status_code == 404: | ||
Console().printer(Fore.LIGHTRED_EX, "Invalid", self.code) | ||
elif req.status_code == 429: | ||
# rate = (int(req.json()['retry_after']) / 1000) + 1 | ||
Console().printer(Fore.LIGHTBLUE_EX, "RTlimit", self.code) | ||
# time.sleep(rate) | ||
else: | ||
Console().printer(Fore.LIGHTYELLOW_EX, " Retry ", self.code) | ||
|
||
except KeyboardInterrupt: | ||
Console().ui() | ||
threading.Lock().acquire() | ||
print(f"{Fore.LIGHTRED_EX} Stopped > {Fore.RESET}Nitro Gen Stopped by Keyboard Interrupt.") | ||
os.system('pause >nul') | ||
exit() | ||
except: | ||
Console().printer(Fore.LIGHTYELLOW_EX, " Retry ", self.code) | ||
|
||
if __name__ == "__main__": | ||
Console().ui() | ||
print(" "+Fore.CYAN + str(Console().proxies_count()) + Fore.RESET + " Total proxies loaded...\n\n") | ||
|
||
while True: | ||
if threading.active_count() <= int(Worker().config("thread")): | ||
DNG = Worker() | ||
DNG.run() |