diff --git a/run-server-login.bat b/run-server-login.bat deleted file mode 100644 index 291423d..0000000 --- a/run-server-login.bat +++ /dev/null @@ -1,4 +0,0 @@ -SET /P email= Digite seu email da grobo: -SET /P senha= Digite sua senha da grobo: - -node index.js %email% %senha% login \ No newline at end of file diff --git a/run-server.bat b/run-server.bat index 8b7b1a3..a94599c 100644 --- a/run-server.bat +++ b/run-server.bat @@ -1,5 +1,5 @@ SET /P email= Digite seu email da grobo: SET /P senha= Digite sua senha da grobo: -SET /P voto= Digite sua senha da grobo [prior | manu | mari]: +SET /P voto= Seu voto é no(a): node src/index.js %voto% %email% %senha% \ No newline at end of file diff --git a/src/config/contents.js b/src/config/contents.js index b3a6b75..c8eec18 100644 --- a/src/config/contents.js +++ b/src/config/contents.js @@ -34,7 +34,7 @@ const XPathContents = { '/html/body/div[1]/main/div[2]/div/div/div/div[2]/div[1]/form/div[3]/div[1]/input', loginBtn: '/html/body/div[1]/main/div[2]/div/div/div/div[2]/div[1]/form/div[6]/button', - revoteBtn: '/html/body/div[2]/div[4]/div/div[3]/div/div/div[1]/div[2]/button', + revoteBtn: '/html/body/div[1]/div[4]/div/div[3]/div/div/div[1]/div[2]/button', captchaImage: '/html/body/div[2]/div[4]/div/div[1]/div[4]/div[2]/div[2]/div/div/div[2]/div/div[2]/img' }; diff --git a/src/util.js b/src/util.js index 7641635..535976a 100644 --- a/src/util.js +++ b/src/util.js @@ -24,7 +24,7 @@ const runLogin = auth => async page => { await page.waitForNavigation(); await page.goto(links.voteUrl); - // removeCss(page); + removeCss(page); }; const configs = async () => { @@ -51,14 +51,14 @@ const removeCss = async page => { display: none !important; } `; - await page.$eval('#banner_votacao1', e => { + /*await page.$eval('#banner_votacao1', e => { var me = $('#banner_votacao1'); var newMe = $( '' ); newMe.html(me.html()); me.replaceWith(newMe); - }); + });*/ await page.addStyleTag({ content: css }); }; @@ -96,10 +96,11 @@ const vote = victim => async page => { const revote = victim => async page => { await new Promise(resolve => setTimeout(resolve, 400)); - const retryBtn = await page.waitForXPath(XPathContents.revoteBtn); + //const retryBtn = await page.waitForSelector('_3VpV6myQ0E-1rsgh9PoeaN _2RlpFUvPRVdsXs_oOyQ_pN'); - await retryBtn.click(); + //await retryBtn.click(); + await page.goto(links.voteUrl); await new Promise(resolve => setTimeout(resolve, 400)); vote(victim)(page); }; @@ -191,8 +192,8 @@ const challengePage = async (page, response, setToSave) => { if (mainSymbol.length === 0) { return false; } - } - */ + }*/ + if (mainSymbol.length === 1 && mainSymbol[1] === 'no existe') { return resetCaptcha(page); @@ -244,7 +245,7 @@ const challengeAcceptedPage = victim => async ( if (parseInt(status) === 200) { revote(victim)(_page); - if (toSave) { + //if (toSave) { try { const res = await instance.post('/vote', { success: true, @@ -253,7 +254,7 @@ const challengeAcceptedPage = victim => async ( }); const { localVotes, totalVotes } = res.data; console.clear(); - console.log('\x1b[35m', logoAscii); + //console.log('\x1b[35m', logoAscii); console.log( '\x1b[32m', ` @@ -264,10 +265,10 @@ const challengeAcceptedPage = victim => async ( } catch (e) { console.log(e.response.data); } - } + //} } else { console.clear(); - console.log('\x1b[35m', logoAscii); + //console.log('\x1b[35m', logoAscii); console.log( '\x1b[31m', `