Skip to content

Instantly share code, notes, and snippets.

@Alex4386
Last active April 25, 2024 01:40
Show Gist options
  • Save Alex4386/332c8377c7e6de8a28f5296cc5f77f81 to your computer and use it in GitHub Desktop.
Save Alex4386/332c8377c7e6de8a28f5296cc5f77f81 to your computer and use it in GitHub Desktop.
Discord Nitro Generator for Opera GX Promotion without even installing Opera GX on your machine - Take that, Golden Brick Silk Road Fund Management!
/**
* Welcome to Cloudflare Workers! This is your first worker.
*
* - Run "npm run dev" in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your worker in action
* - Run "npm run deploy" to publish your worker
*
* Learn more at https://developers.cloudflare.com/workers/
*/
const OPERA_GX_DISCORD = "https://api.discord.gx.games/v1/direct-fulfillment";
function generateUUID() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(t) {
const e = 16 * Math.random() | 0;
return ("x" === t ? e : 3 & e | 8).toString(16)
}));
}
export default {
async fetch(request, env, ctx) {
const tmpUuid = generateUUID();
const regReq = await fetch(OPERA_GX_DISCORD, {
method: "POST",
headers: {
"Accept": "*/*",
"Content-Type": "application/json",
"Origin": "https://www.opera.com",
"Referer": "https://www.opera.com/",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0",
},
body: JSON.stringify({
partnerUserId: tmpUuid,
}),
});
const data = await regReq.json();
const url = "https://discord.com/billing/partner-promotions/1180231712274387115/" + data.token;
return new Response('Redirecting to '+url, {
headers: {
"Location": url,
},
status: 302,
});
},
};
function generateUUID() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(t) {
const e = 16 * Math.random() | 0;
return ("x" === t ? e : 3 & e | 8).toString(16)
}));
}
const OPERA_GX_DISCORD = "https://api.discord.gx.games/v1/direct-fulfillment";
async function generateNitro() {
const tmpUuid = generateUUID();
const regReq = await fetch(OPERA_GX_DISCORD, {
method: "POST",
headers: {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0",
},
body: JSON.stringify({
partnerUserId: tmpUuid,
}),
});
const data = await regReq.json();
const url = "https://discord.com/billing/partner-promotions/1180231712274387115/" + data.token;
return url;
}
const fetch = require('node-fetch');
const fs = require('fs');
const OPERA_GX_DISCORD = "https://api.discord.gx.games/v1/direct-fulfillment";
function generateUUID() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(t) {
const e = 16 * Math.random() | 0;
return ("x" === t ? e : 3 & e | 8).toString(16)
}));
}
async function getDiscordFreeNitro() {
const tmpUuid = generateUUID();
const regReq = await fetch(OPERA_GX_DISCORD, {
method: "POST",
headers: {
"Accept": "*/*",
"Content-Type": "application/json",
"Origin": "https://www.opera.com",
"Referer": "https://www.opera.com/",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0",
},
body: JSON.stringify({
partnerUserId: tmpUuid,
}),
});
const data = await regReq.json();
const url = "https://discord.com/billing/partner-promotions/1180231712274387115/" + data.token;
return url;
}
async function main() {
for (let i = 0; i < 10; i++) {
const url = await getDiscordFreeNitro();
console.log(url);
fs.appendFileSync('nitro.txt', url + "\n");
}
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment