Closed Sirmagee closed 7 months ago
i fix this logging accounts by puppeeter, email and password #uid_5 #uid_7, getting the token by the code that selfbotv13 send to us, and closing browser, doing that my account stay logged and the token don't refresh, was kind hard but if you guys want to see the logic,
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
(async () => { for (const account of accounts) { const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage();
try {
await page.goto('https://discord.com/login');
// Aguarde até que o elemento #uid_5 esteja presente na página
await page.waitForSelector('#uid_5', { visible: true });
// Aguarde 3 segundos após a presença do elemento
await delay(2000);
await page.type('#uid_5', account.email);
await page.type('#uid_7', account.password);
await Promise.all([
page.waitForNavigation(),
page.click('.button__47891'),
]);
// Aguarde a página carregar completamente
await page.waitForTimeout(3000);
const client = await page.target().createCDPSession();
await client.send('Debugger.enable');
await client.send('Runtime.evaluate', {
expression: `
window.webpackChunkdiscord_app.push([
[Math.random()],
{},
req => {
if (!req.c) return;
for (const m of Object.keys(req.c)
.map(x => req.c[x].exports)
.filter(x => x)) {
if (m.default && m.default.getToken !== undefined) {
window.discordToken = m.default.getToken();
}
if (m.getToken !== undefined) {
window.discordToken = m.getToken();
}
}
}
]);
`,
});
const result = await page.evaluate(() => ({
discordToken: window.discordToken,
}));
console.log(`Token: ${result.discordToken}`);
// Agora, vamos fazer uma solicitação à API do Discord para obter o username
const usernameResponse = await page.evaluate(async () => {
const response = await fetch('https://discord.com/api/v9/users/@me', {
method: 'GET',
headers: {
'authorization': window.discordToken,
},
});
return response.json();
});
const username = usernameResponse.username;
console.log(`Username: ${username}`);
// Salvar token e nome de usuário no arquivo token.txt
await fs.appendFile('token.txt', `Token: ${result.discordToken}, Username: ${username}\n`);
} catch (error) {
console.error(`Erro ao processar a conta: ${account.email}`);
console.error(error);
} finally {
// Feche a página
try {
await browser.close();
} catch (error) {
console.error(`Erro ao fechar a página: ${error}`);
}
}
// Aguarde um intervalo de 2 segundos antes de prosseguir para a próxima conta
await delay(1000);
} })();
i fix this logging accounts by puppeeter, email and password #uid_5 #uid_7, getting the token by the code that selfbotv13 send to us, and closing browser, doing that my account stay logged and the token don't refresh, was kind hard but if you guys want to see the logic,
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
(async () => { for (const account of accounts) { const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage();
try { await page.goto('https://discord.com/login'); // Aguarde até que o elemento #uid_5 esteja presente na página await page.waitForSelector('#uid_5', { visible: true }); // Aguarde 3 segundos após a presença do elemento await delay(2000); await page.type('#uid_5', account.email); await page.type('#uid_7', account.password); await Promise.all([ page.waitForNavigation(), page.click('.button__47891'), ]); // Aguarde a página carregar completamente await page.waitForTimeout(3000); const client = await page.target().createCDPSession(); await client.send('Debugger.enable'); await client.send('Runtime.evaluate', { expression: ` window.webpackChunkdiscord_app.push([ [Math.random()], {}, req => { if (!req.c) return; for (const m of Object.keys(req.c) .map(x => req.c[x].exports) .filter(x => x)) { if (m.default && m.default.getToken !== undefined) { window.discordToken = m.default.getToken(); } if (m.getToken !== undefined) { window.discordToken = m.getToken(); } } } ]); `, }); const result = await page.evaluate(() => ({ discordToken: window.discordToken, })); console.log(`Token: ${result.discordToken}`); // Agora, vamos fazer uma solicitação à API do Discord para obter o username const usernameResponse = await page.evaluate(async () => { const response = await fetch('https://discord.com/api/v9/users/@me', { method: 'GET', headers: { 'authorization': window.discordToken, }, }); return response.json(); }); const username = usernameResponse.username; console.log(`Username: ${username}`); // Salvar token e nome de usuário no arquivo token.txt await fs.appendFile('token.txt', `Token: ${result.discordToken}, Username: ${username}\n`); } catch (error) { console.error(`Erro ao processar a conta: ${account.email}`); console.error(error); } finally { // Feche a página try { await browser.close(); } catch (error) { console.error(`Erro ao fechar a página: ${error}`); } } // Aguarde um intervalo de 2 segundos antes de prosseguir para a próxima conta await delay(1000);
} })();
Kinda complicated.
Which package has the bugs?
The core library
Issue description
when i try to log with token, my token keep changing and everytime i get, token invalid, i don't what to do, i tried a function to log with email and password get the same error, any way to fix this?
Code sample
No response
Package version
2.15.1
Node.js version
Node.js 19.9
Operating system
Windows
Priority this issue should have
High (immediate attention needed)
Checklist
Additional Information
No response