Last active
March 1, 2024 11:58
-
-
Save DatDraggy/ac3a0c0e9a2571e2829bed1b36ea0bdb to your computer and use it in GitHub Desktop.
Teamspeak Server Nickname Snatcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** npm i puppeteer | |
** node run.js | |
** Made by DatDraggy | |
*/ | |
const email = 'me@example.com'; | |
const password = 'p4ssw0rd'; | |
const nicknames = ['example', 'example2']; | |
const domain = 'example.com'; | |
const showBrowser = true; | |
//--------------- | |
import puppeteer from 'puppeteer'; | |
const browser = await puppeteer.launch({headless: !showBrowser}); | |
const page = await browser.newPage(); | |
await page.setViewport({width: 1024, height: 1024}); | |
await page.goto('https://www.myteamspeak.com/logout'); | |
await page.goto('https://www.myteamspeak.com/login'); | |
await page.waitForSelector('.login-content'); | |
if (await page.$('.cc-deny') !== null) { | |
await page.click('.cc-deny'); | |
} | |
await page.type('.email-wrapper__item', email); | |
await page.type('.password-wrapper__item', password); | |
await page.waitForSelector('.btn-primary'); | |
await page.click('.btn-primary'); | |
await page.waitForSelector('#dashboard-panel'); | |
await page.goto('https://www.myteamspeak.com/server-nicknames'); | |
await (async function () { | |
for (let i = 0; i < nicknames.length; i++) { | |
let nickname = nicknames[i]; | |
await page.waitForSelector('#server-names'); | |
await delay(1000); | |
if (await page.$('.sn-item-editing') === null) { | |
await page.click('.bottom-section > .btn-primary'); | |
} | |
await page.waitForSelector('.sn-item-editing'); | |
await page.type('.sn-item-editing input[name="sn-name"]', nickname); | |
await page.type('.sn-item-editing input[name="sn-domain"]', domain); | |
await delay(1000); | |
await page.waitForSelector('.sn-item-editing .sn-btn-save'); | |
await page.click('.sn-item-editing .sn-btn-save'); | |
await delay(1000); | |
if (await page.$('.swal2-modal') !== null) { | |
await page.click('.swal2-confirm'); | |
await delay(500); | |
await page.click('.sn-item-editing .sn-action-delete'); | |
await delay(500); | |
await page.click('.swal2-confirm'); | |
} | |
} | |
})(); | |
await browser.close(); | |
async function delay(s) { | |
await new Promise((r) => {setTimeout(r, s)}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment