Skip to content

Instantly share code, notes, and snippets.

@imeesa
Created March 22, 2024 21:51
Show Gist options
  • Save imeesa/549b5a17280d50f595af5027fff1852e to your computer and use it in GitHub Desktop.
Save imeesa/549b5a17280d50f595af5027fff1852e to your computer and use it in GitHub Desktop.
free nitro thing. make a gx account and get the session. i'll adda youtube tutorial at some point
import requests
headers = {
'authority': 'discord.opr.gg',
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'authorization': 'nope',
# 'content-length': '0',
'origin': 'https://www.opera.com',
'referer': 'https://www.opera.com/',
'sec-ch-ua': '"Not A(Brand";v="99", "Opera GX";v="107", "Chromium";v="121"',
'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/121.0.0.0 Safari/537.36 OPR/107.0.0.0',
}
cookies_gettoken = {
'SESSION_TYPE': 'user',
'SESSION': 'get ur own token lol',
}
headers_gettoken = {
'authority': 'api.gx.me',
'accept': 'application/json',
'accept-language': 'en-US,en;q=0.9',
# 'cookie': 'SESSION_TYPE=user; SESSION=MWU4ZmIxMmUtMmUzMy00NGI2LWFlNjAtZDVmMmU4NTc1ZDdi',
'origin': 'https://www.opera.com',
'referer': 'https://www.opera.com/',
'sec-ch-ua': '"Not A(Brand";v="99", "Opera GX";v="107", "Chromium";v="121"',
'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/121.0.0.0 Safari/537.36 OPR/107.0.0.0',
}
def get_discord_nitro():
token = requests.get('https://api.gx.me/profile/token', cookies=cookies_gettoken, headers=headers_gettoken).content.decode('utf8').split('"')[3]
headers['authorization'] = token
response = requests.post('https://discord.opr.gg/v2/direct-fulfillment', headers=headers).content
print(response.decode('utf8'))
return 'https://discord.com/billing/partner-promotions/1180231712274387115/'+response.decode('utf8').split('"')[3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment