const Captcha = require("2captcha"); const WebSocket = require('ws'); const fetch = require('node-fetch'); var accessTokens = []; const ws = new WebSocket('wss://irc-ws.chat.twitch.tv/'); ws.on('open', function open() { ws.send("CAP REQ :twitch.tv/tags twitch.tv/commands"); ws.send('PASS oauth:'); ws.send('NICK ajenix69'); ws.send('USER ajenix69 8 * :ajenix69'); ws.send('JOIN #ajenix69'); }); // A new 'solver' instance with our API key ws.onmessage = function(message) { var g = message.data.split(";"); var messageArray = []; console.log(message.data); if(g.length == 15) { console.log(g[4].split("=")[1]); if(g[4].split("=")[1].match(/skrjud/i)) { var code = g[14].split(":")[2].trim(); /* Example ReCaptcha Website */ var dates = []; accessTokens.forEach(token => { var solver = new Captcha.Solver("b012223add489e50ee186c7987fbe2b9"); var resu = ""; solver.hcaptcha("12c3f8c6-a15c-4b83-8767-8050ee30fb70", `https://stake.com/settings/offers?code=${code}&modal=redeemBonus&type=drop`) .then((res) => { console.log("done"); resu = res.data; }); var interval = setInterval(function() { if(!resu == "") { var currentdate = new Date(); var datetime = "Last Sync: " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds(); console.log(datetime); dates.push(datetime); fetch("https://api.stake.com/graphql", { "headers": { "accept": "*/*", "accept-language": "en-US,en;q=0.9", "content-type": "application/json", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "x-access-token": `${token}`, "x-language": "en", "x-lockdown-token": "" }, "referrer": "https://stake.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": "{\"operationName\":\"ClaimConditionBonusCode\",\"variables\":{\"code\":\"" + code + "\",\"currency\":\"ltc\",\"captcha\":\"" + resu + "\"},\"query\":\"mutation ClaimConditionBonusCode($code: String!, $currency: CurrencyEnum!, $captcha: String!) {\\n claimConditionBonusCode(code: $code, currency: $currency, captcha: $captcha) {\\n bonusCode {\\n id\\n code\\n __typename\\n }\\n amount\\n currency\\n user {\\n id\\n balances {\\n available {\\n amount\\n currency\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}", "method": "POST", "mode": "cors", "credentials": "omit" }).then(res => res.json()).then(res => {console.log(res);});; clearInterval(interval); console.log(dates); }},100); }); } } }; setInterval(function() { ws.send(3); },20000);