41 lines
1.5 KiB
JavaScript
Executable file
41 lines
1.5 KiB
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
const pup = require("puppeteer-extra");
|
|
const stl = require("puppeteer-extra-plugin-stealth");
|
|
const two = require("2captcha");
|
|
require("dotenv").config();
|
|
|
|
(async function() {
|
|
pup.use(stl());
|
|
|
|
//console.log(process.env.TWOCAPTCHA);
|
|
|
|
let b = await pup.launch({headless: true});
|
|
let p = await b.newPage();
|
|
|
|
await p.goto("https://freealts.pw/minecraft");
|
|
await p.waitForSelector(".button_gen", {visible: true});
|
|
await p.click(".button_gen");
|
|
await p.bringToFront();
|
|
await p.waitForTimeout(5000);
|
|
await p.goto("https://freealts.pw/minecraft/redirect2");
|
|
await p.waitForNavigation();
|
|
await p.waitForTimeout(10000);
|
|
await p.goto("https://freealts.pw/minecraft/redirect3", {waitUntil: "networkidle2"});
|
|
let tw = new two.Solver(process.env.TWOCAPTCHA);
|
|
tw = await tw.hcaptcha("4c8226dd-700a-4d9d-8b47-a0a672ec6abd", "https://freealts.pw/minecraft");
|
|
await p.evaluate(`document.querySelector("[name='h-captcha-response']").value = "${tw.data}";`);
|
|
await p.evaluate(`document.querySelector("[name='g-recaptcha-response']").value = "${tw.data}";`);
|
|
await p.click("input[type=submit]");
|
|
await p.waitForNavigation();
|
|
if ((await p.$("#alt"))) {
|
|
let content = await p.evaluate(function() {return document.getElementById("alt").value;});
|
|
console.log(`username: ${content.split(":")[0]}\npassword: ${content.split(":").slice(1).join(":")}`);
|
|
await b.close();
|
|
process.exit();
|
|
} else {
|
|
console.log("Error\nSite has changed, update the repo or try again.");
|
|
await b.close();
|
|
process.exit(1);
|
|
}
|
|
})(); |