-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnitrogen.py
39 lines (30 loc) · 1.24 KB
/
nitrogen.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
import requests
import concurrent.futures
import json
import hashlib
import uuid
def generate_id():
return hashlib.sha256(uuid.uuid4().bytes).hexdigest()
generated = []
class Discord:
def __init__(self):
self.session = requests.Session()
self.session.headers.update({'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36'})
def jwtToken(self):
try:
r = self.session.post('https://api.discord.gx.games/v1/direct-fulfillment', json={"partnerUserId":generate_id()})
return r.json()['token']
except:
pass
def nitro(self):
token = self.jwtToken()
return f'https://discord.com/billing/partner-promotions/1180231712274387115/{token}'
if __name__ == '__main__':
dc = Discord()
howmuch = int(input('How many codes do you want to generate? '))
with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor:
for _ in range(howmuch):
future = executor.submit(dc.nitro)
generated.append(future.result())
with open('generated.json', 'w') as f:
json.dump(generated, f, indent=4)