Skip to content

Instantly share code, notes, and snippets.

@mov-ebx
Last active December 30, 2023 19:03
Show Gist options
  • Save mov-ebx/3992b676b22ab865095c204de03b7021 to your computer and use it in GitHub Desktop.
Save mov-ebx/3992b676b22ab865095c204de03b7021 to your computer and use it in GitHub Desktop.
A Discord Nitro generator (1 month) using the Opera GX promotion
import requests, time, uuid
headers = {'authority':'api.discord.gx.games','accept':'*/*','accept-language':'en-US,en;q=0.9','content-type':'application/json','origin':'https://www.opera.com','referer':'https://www.opera.com/','sec-ch-ua':'"Opera GX";v="105", "Chromium";v="119", "Not?A_Brand";v="24"','sec-ch-ua-mobile':'?0','sec-ch-ua-platform':'"Windows"','sec-fetch-dest':'empty','sec-fetch-mode':'cors','sec-fetch-site':'cross-site','user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0'}
def now():
return f'[{time.strftime("%H:%M:%S")}]'
wait_time = 0
def generate():
global wait_time
r = requests.post('https://api.discord.gx.games/v1/direct-fulfillment', headers=headers, json={'partnerUserId':str(uuid.uuid4())})
if r.status_code == 429:
wait_time = wait_time + 30 if wait_time <= 270 else wait_time
print(f'{now()} Ratelimited, waiting {wait_time} seconds.')
time.sleep(wait_time)
elif r.status_code == 200:
wait_time = 0
return f'https://discord.com/billing/partner-promotions/1180231712274387115/{r.json()["token"]}\n'
else:
print(f'{now()} Failed to generate promotion: Error code {r.status_code}')
if __name__ == '__main__':
try:
while True:
try:
nitro = generate()
if nitro:
with open('nitro.txt', 'a') as txt:
txt.write(nitro)
except Exception as e:
print(f'{now()} Failed to generate promotion: {e}')
except KeyboardInterrupt:
pass
@qurabiye
Copy link

ty

@qurabiye
Copy link

hhjh

@qurabiye
Copy link

ghh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment