Code Monkey home page Code Monkey logo

Comments (2)

Sirmagee avatar Sirmagee commented on June 11, 2024

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);

}
})();

from discord.js-selfbot-v13.

MEZBATHEKING avatar MEZBATHEKING commented on June 11, 2024

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.

from discord.js-selfbot-v13.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.