Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Jul 18, 2026. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBitGen.py
More file actions
Latest commit
167 lines (156 loc) · 7.73 KB
/
Copy pathBitGen.py
File metadata and controls
167 lines (156 loc) · 7.73 KB
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
165
166
167
fromastimportGlobal
importrandom, string, os, aiohttp, asyncio, requests, ab5
fromrequests.exceptionsimportTimeout
fromdiscord_webhookimportDiscordWebhook, DiscordEmbed
classcolor:
VIOLET, CYAN, DARK_CYAN, BLUE, GREEN, YELLOW, RED, WHITE, BLACK, GRAY, MAGENTA, BOLD, DIM, NORMAL, UNDERLINED, STOP='\033[95m', '\033[96m', '\033[36m', '\033[94m', '\033[92m', '\033[93m', '\033[91m', '\033[37m', '\033[30m','\033[38;2;88;88;88m', '\033[35m', '\033[1m', '\033[2m', '\033[22m', '\033[4m', '\033[0m'
defgen_code(lenght: int):
return''.join(random.choice(string.ascii_letters+string.digits) foriinrange(lenght))
defscrape():
f, scraped=open('proxies.txt', 'a+'), 0
f.truncate(0)
r, proxies=requests.get('https://api.proxyscrape.com/?request=displayproxies'), []
forproxyinr.text.split('\n'):
ifproxy:
proxy='https://{}'.format(proxy).strip()
proxies.append(proxy)
forpinproxies:
scraped+=1
f.write('{}\n'.format(p))
f.close()
returnscraped
defreadproxies():
try:
p=open('proxies.txt', encoding='UTF-8')
exceptFileNotFoundError:
p=open('proxies.txt', 'w+', encoding='UTF-8')
raiseSystemExit
rproxy=p.read().split('\n')
foriinrproxy:
ifi==''or' ':
index=rproxy.index(i)
delrproxy[index]
p.close()
returnrproxy
defask(question: str):
returnstr(input('[ {0.MAGENTA}?{0.STOP} ] {0.GRAY}{1}:{0.STOP} '.format(color, question)))
rproxy=readproxies()
asyncdefmain():
checker=boost=False
os.system('cls'ifos.name=='nt'else'clear')
logo= ('''
__________.__ __ ________
\______ \__|/ |_ / _____/ ____ ____
| | _/ \ __\/ \ ____/ __ \ / \
| | \ || | \ \_\ \ ___/| | \
|______ /__||__| \______ /\___ >___| /
\/ \/ \/ \/
''')
print(ab5.hgratient(logo, [0, 223, 50], [0, 25, 222]))
print('[ {0.YELLOW}>{0.STOP} ] {0.GRAY}Made with {0.RED}<3{0.STOP} {0.GRAY}by{0.STOP} DaniDuese ({0.DARK_CYAN}{0.UNDERLINED}https://github.com/DaniEnsi{0.STOP})\n'.format(color))
try:
globalcount
count=int(ask('How much codes should be generated'))
exceptValueError:
print('\n[ {0.RED}>{0.STOP} ] {0.GRAY}Please enter an integer{0.STOP} !\n'.format(color))
returnexit()
boost=Trueifask('Boost codes or Classic codes (boost/classic)').lower() =='boost'elseFalse
ifask('Enable Webhook (yes/no)').lower() =='yes':
globalwebhookval
globalwebhookurl
webhookurl=ask('Webhook URL: ')
webhook=DiscordWebhook(url=webhookurl, timeout=1.0)
embed=DiscordEmbed(
title='Webhook Initialized', description='If you can see this Message, the webhook is working!', color=0x00ff00)
embed.set_thumbnail(
url='https://cdn.discordapp.com/attachments/1009045524667715714/1031322268896350238/unknown.png')
embed.set_footer(text='BitGen™ - Nitro Generator')
embed.set_timestamp()
webhook.add_embed(embed)
try:
response=webhook.execute()
ifask('Did you get the message? (yes/no)').lower() =='yes':
webhookval=True
else:
print('[ {0.RED}>{0.STOP} ] {0.GRAY}Please retry{0.STOP} !\n'.format(color))
returnexit()
exceptTimeoutaserr:
print(f'Oops! Connection to Discord timed out: {err}')
returnexit()
else:
webhookval=False
ifask('Enable Checker (yes/no)').lower() =='yes':
try:
valid, invalid, checker= [], 0, True
print('\n[ {0.BLUE}i{0.STOP} ] {1} {0.GRAY}scraped proxys.{0.STOP}'.format(color, scrape()))
except:
print('\n[ {0.RED}>{0.STOP} ] {0.GRAY}Check your internet connection !{0.STOP}\n'.format(color))
input('Press enter to continue... ')
returnexit()
else:
valid=invalid='CHECKER NOT ENABLED'
checker=False
print('')
whilecount>0:
ifboost:
code=gen_code(24)
else:
code=gen_code(16)
ifchecker:
count-=1
badge='#'
asyncwithaiohttp.ClientSession() assession:
asyncwithsession.get('https://discordapp.com/api/v9/entitlements/gift-codes/{}?with_application=false&with_subscription_plan=true'.format(code)) asresponse:
ifresponse.status==429:
try:
proxi=random.choice(rproxy)
index=rproxy.index(proxi)
delrproxy[index]
exceptIndexError:
print('\n[ {0.RED}>{0.STOP} ] {0.GRAY}There are no more proxies available !{0.STOP}\n'.format(color))
print('[ {0.YELLOW}>{0.STOP} ] Result:\n{0.RED}Invalid{0.STOP}: {1}\n{0.GREEN}Valid{0.STOP}: {2}\n{0.GREEN}Links{0.STOP}: {3}\n'.format(color, invalid, len(valid), ', '.join(valid)))
input('Press enter to continue... ')
returnexit()
invalid+=1
badge='{0.RED}-{0.STOP}'.format(color)
elifresponse.status==404:
invalid+=1
badge='{0.RED}-{0.STOP}'.format(color)
elifresponse.status==200:
valid.append('https://discord.gift/{}'.format(code))
badge='{0.GREEN}+{0.STOP}'.format(color)
print('[ {1} ] {0.DARK_CYAN}{0.UNDERLINED}https://discord.gift/{2}{0.STOP}'.format(color, badge, code))
else:
count-=1
print('[ {0.BLUE}~{0.STOP} ] {0.DARK_CYAN}{0.UNDERLINED}https://discord.gift/{1}{0.STOP}'.format(color, code))
return [invalid, valid]
if__name__=='__main__':
gen=asyncio.get_event_loop().run_until_complete(main())
invalid=gen[0]
ifgen[1] == []:
valid=0
else:
valid=gen[1]
num=int(valid+invalid)
ifwebhookval==True:
webhook=DiscordWebhook(url=webhookurl, timeout=1.0)
embed=DiscordEmbed(
title='Nitro Codes Created', description='BitGen™ has created and checked '+str(num) +' Nitro Codes...', color=0x000000)
embed.add_embed_field(name='Vaid Codes:', value=valid)
embed.add_embed_field(name='Invalid Codes', value=invalid)
embed.set_thumbnail(
url='https://cdn.discordapp.com/attachments/1009045524667715714/1031322268896350238/unknown.png')
embed.set_footer(text='BitGen™ - Nitro Generator')
embed.set_timestamp()
webhook.add_embed(embed)
try:
response=webhook.execute()
exceptTimeoutaserr:
print(f'Oops! Connection to Discord timed out: {err}')
exit()
else:
pass
print('\n[ {0.YELLOW}>{0.STOP} ] Result:\n{0.RED}Invalid{0.STOP}: {1[0]}\n{0.GREEN}Valid{0.STOP}: {2}\n{0.GREEN}Links{0.STOP}: {3}'.format(color, gen, gen[1], gen[1])) ifgen[1] =='CHECKER NOT ENABLED'elseprint('\n[ {0.YELLOW}>{0.STOP} ] Result:\n{0.RED}Invalid{0.STOP}: {1[0]}\n{0.GREEN}Valid{0.STOP}: {2}\n{0.GREEN}Links{0.STOP}: {3}'.format(color, gen, len(gen[1]), ', '.join(gen[1])))
print('\n[ {0.MAGENTA}*{0.STOP} ] {0.GRAY}Thanks for using our nitro generator !{0.STOP}\n'.format(color))
input('Press enter to continue... ')
exit()