-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
164 lines (137 loc) · 5.88 KB
/
main.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import ctypes
import string
import os
import time
# IMPORTANT VARIABLES
USE_WEBHOOK = True
discordWebhookURL = "[INSERT DISCORD WEBHOOK URL HERE]"
time.sleep(3)
os.system('cls' if os.name == 'nt' else 'clear')
try:
from discord_webhook import DiscordWebhook
except ImportError:
input(
f"Module discord_webhook not installed, to install run '{'py -3' if os.name == 'nt' else 'python3.8'} -m pip install discord_webhook'\nYou can ignore this error if you aren't going to use a webhook.\nPress enter to continue.")
USE_WEBHOOK = False
try:
import requests
except ImportError:
input(
f"Module requests not installed, to install run '{'py -3' if os.name == 'nt' else 'python3.8'} -m pip install requests'\nPress enter to exit")
exit()
try:
import numpy
except ImportError:
input(
f"Module numpy not installed, to install run '{'py -3' if os.name == 'nt' else 'python3.8'} -m pip install numpy'\nPress enter to exit")
exit()
url = "https://github.com"
try:
response = requests.get(url)
print("Internet check")
time.sleep(.4)
except requests.exceptions.ConnectionError:
input("You are not connected to internet, check your connection and try again.\nPress enter to exit")
exit()
class NitroGen:
def __init__(self):
self.fileName = "Nitro Codes.txt"
def main(self):
os.system('cls' if os.name == 'nt' else 'clear')
if os.name == "nt":
print("")
ctypes.windll.kernel32.SetConsoleTitleW(
"Nitro Generator and Checker - Made by https://www.youtube.com/@hassamohammed")
else:
print(f'\33]0;Nitro Generator and Checker - Made by https://www.youtube.com/@hassamohammed\a',
end='', flush=True)
print(""" $$\
$$ |
$$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$\$$$$\ $$$$$$\
$$ __$$\ \____$$\ $$ _____|$$ _____| \____$$\ $$ _$$ _$$\ $$ __$$\
$$ | $$ | $$$$$$$ |\$$$$$$\ \$$$$$$\ $$$$$$$ |$$ / $$ / $$ |$$ / $$ |
$$ | $$ |$$ __$$ | \____$$\ \____$$\ $$ __$$ |$$ | $$ | $$ |$$ | $$ |
$$ | $$ |\$$$$$$$ |$$$$$$$ |$$$$$$$ |\$$$$$$$ |$$ | $$ | $$ |\$$$$$$ |
\__| \__| \_______|\_______/ \_______/ \_______|\__| \__| \__| \______/
""")
time.sleep(2)
self.slowType("Made by: https://www.youtube.com/@hassamohammed", .02)
time.sleep(1)
self.slowType(
"\nInput How Many Codes to Generate and Check: ", .02, newLine=False)
try:
num = int(input(''))
except ValueError:
input("Specified input wasn't a number.\nPress enter to exit")
exit()
if USE_WEBHOOK:
self.slowType(
"To continue please input the number '1': ", .02, newLine=False)
url = discordWebhookURL
discordWebhookURL2 = input()
webhook = discordWebhookURL2 if discordWebhookURL2 != "" else None
if webhook is not None:
DiscordWebhook(
url=url,
content=f"```Started checking urls\nI will send any valid codes here```"
).execute()
valid = []
invalid = 0
chars = []
chars[:0] = string.ascii_letters + string.digits
c = numpy.random.choice(chars, size=[num, 16])
for s in c:
try:
code = ''.join(x for x in s)
url = f"https://discord.gift/{code}"
result = self.quickChecker(url, webhook)
if result:
valid.append(url)
else:
invalid += 1
except KeyboardInterrupt:
print("\nInterrupted by user")
break
except Exception as e:
print(f" Error | {url} ")
if os.name == "nt":
ctypes.windll.kernel32.SetConsoleTitleW(
f"Nitro Generator and Checker - {len(valid)} Valid | {invalid} Invalid - Made by https://www.youtube.com/@hassamohammed")
print("")
else:
print(
f'\33]0;Nitro Generator and Checker - {len(valid)} Valid | {invalid} Invalid - Made by https://www.youtube.com/@hassamohammed\a', end='', flush=True)
print(f"""
Results:
Valid: {len(valid)}
Invalid: {invalid}
Valid Codes: {', '.join(valid)}""")
input("\nThe end! Press Enter 5 times to close the program.")
[input(i) for i in range(4, 0, -1)]
def slowType(self, text: str, speed: float, newLine=True):
for i in text:
print(i, end="", flush=True)
time.sleep(speed)
if newLine:
print()
def quickChecker(self, nitro:str, notify=None):
url = f"https://discordapp.com/api/v9/entitlements/gift-codes/{nitro}?with_application=false&with_subscription_plan=true"
response = requests.get(url)
if response.status_code == 200:
print(f" Valid | {nitro} ", flush=True,
end="" if os.name == 'nt' else "\n")
with open("Nitro Codes.txt", "w") as file:
file.write(nitro)
if notify is not None:
DiscordWebhook(
url=url,
content=f"WORKING NITRO CODE FOUND, REDEEM IT NOW! @everyone \n{nitro}"
).execute()
return True
else:
print(f" Invalid | {nitro} ", flush=True,
end="" if os.name == 'nt' else "\n")
return False
if __name__ == '__main__':
Gen = NitroGen()
Gen.main()