From 54e8cfd029ca12a0f8ccab14e21e69af6d4170b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Bragan=C3=A7a?= Date: Fri, 3 Apr 2020 23:53:15 -0300 Subject: [PATCH 1/3] Changed from name to number (0, 1, or 2) for the voting option; Changed the URL to the current pool and changed the code to the one proposed by gameszaum * Code improvements by gameszaum * Changed the URL to the current pool * Changed .bat script to the number voting option --- run-server.bat | 8 ++++---- src/cli.js | 18 ++++-------------- src/config/contents.js | 42 +++++++++++++++++++++--------------------- src/util.js | 26 ++++++++++++++------------ 4 files changed, 43 insertions(+), 51 deletions(-) diff --git a/run-server.bat b/run-server.bat index 8b7b1a3..96dcc7d 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 opcao de voto [0 | 1 | 2]: +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]: -node src/index.js %voto% %email% %senha% \ No newline at end of file +node src/index.js %voto% %email% %senha% \ No newline at end of file diff --git a/src/cli.js b/src/cli.js index 3ac99c6..a5f41b7 100644 --- a/src/cli.js +++ b/src/cli.js @@ -2,21 +2,11 @@ require('dotenv/config'); const getVictim = name => { - name = name.toLowerCase(); - switch (name) { - case 'prior': - return 0; - case 'manu': - return 1; - case 'mari': - return 2; - } - - throw new Error('candidato invalido, use prior | manu | mari'); + throw new Error('candidato invalido, use 0 | 1 | 2'); }; module.exports = () => { - const victim = process.argv[2] || 'manu'; + const victim = process.argv[2] || 'gabi'; const email = process.argv[3] || process.env.EMAIL; const password = process.argv[4] || process.env.PASSWORD; @@ -29,8 +19,8 @@ module.exports = () => { console.log( `[❌] Erro: Comando invalido - Utilize: node src/index.js [prior | manu | mari] seu@email.com sua_senha - Exemplo: node src/index.js prior eduardo@gmail.com minhasenha123` + Utilize: node src/index.js [0 | 1 | 2] seu@email.com sua_senha + Exemplo: node src/index.js 1 eduardo@gmail.com minhasenha123` .split('\n') .map(str => str.trim()) .join('\n') diff --git a/src/config/contents.js b/src/config/contents.js index b3a6b75..6381657 100644 --- a/src/config/contents.js +++ b/src/config/contents.js @@ -1,26 +1,26 @@ const logoAscii = ` -\`-+syhhys+:\` ./syhhhs: -/hmmmmmmmmmd+ \`:ymmmmmmy- -smmmmmdhhddo. \`/hmmmmmds- \`:. -/mmmmms. .. \`+hmmmmmdo. \`:ymy -+mmmmm/ .+dmmmmmdo. \`/hmmmh -.dmmmmdo-.odmmmmmh+. .+s-.+hmmmmm/ --ymmmmmddmmmmmh/\` .odmmmdmmmmmd/ -\`:ymmmmmmmmh/\` .smmmmmmmmh+. - \`:ymmmmy:\` .smmmmmmh/\` - -sy:\` -sdmmmmmh/\` - -ymmmmmmy:\` - -ymmmmmmy- - \`+dmmms- - \`+s. +\`-+syhhys+:\` ./syhhhs: +/hmmmmmmmmmd+ \`:ymmmmmmy- +smmmmmdhhddo. \`/hmmmmmds- \`:. +/mmmmms. .. \`+hmmmmmdo. \`:ymy ++mmmmm/ .+dmmmmmdo. \`/hmmmh +.dmmmmdo-.odmmmmmh+. .+s-.+hmmmmm/ +-ymmmmmddmmmmmh/\` .odmmmdmmmmmd/ +\`:ymmmmmmmmh/\` .smmmmmmmmh+. + \`:ymmmmy:\` .smmmmmmh/\` + -sy:\` -sdmmmmmh/\` + -ymmmmmmy:\` + -ymmmmmmy- + \`+dmmms- + \`+s. HE4RT DEVELOPERS - DISCORD.IO/HE4RT + DISCORD.IO/HE4RT `; const links = { loginUrl: 'https://minhaconta.globo.com', voteUrl: - 'https://gshow.globo.com/realities/bbb/bbb20/votacao/paredao-bbb20-quem-voce-quer-eliminar-felipe-manu-ou-mari-a9f49f90-84e2-4c12-a9af-b262e2dd5be4.ghtml', + 'https://gshow.globo.com/realities/bbb/bbb20/votacao/paredao-bbb20-quem-voce-quer-eliminar-babu-gabi-ou-thelma-305135b8-b442-4cc8-888f-2a01ed79cc2d.ghtml', challengeUrl: 'https://captcha.globo.com/api/challenge/generate', challengeAcceptedUrl: 'https://royale.globo.com/polls/8e81660d-89b5-4777-a324-6f2da878c5c7', @@ -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' }; @@ -45,10 +45,10 @@ const users = [ '/html/body/div[2]/div[4]/div/div[1]/div[4]/div[3]/div' ]; -/* - PRIOR = 0 - MANU = 1 - MARI = 2 +/* + BABU = 0 + GABI = 1 + THELMA = 2 */ module.exports = { diff --git a/src/util.js b/src/util.js index 7641635..e3cc3d8 100644 --- a/src/util.js +++ b/src/util.js @@ -11,6 +11,7 @@ let availableImages = []; const fsExtra = require('fs-extra'); const timeout = ms => new Promise(resolve => setTimeout(resolve, ms)); + const runLogin = auth => async page => { await page.goto(links.loginUrl); @@ -24,7 +25,7 @@ const runLogin = auth => async page => { await page.waitForNavigation(); await page.goto(links.voteUrl); - // removeCss(page); + removeCss(page); }; const configs = async () => { @@ -51,14 +52,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 +97,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 +193,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 +246,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 +255,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 +266,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', ` @@ -321,4 +323,4 @@ module.exports = ({ victim, login }) => ({ listenEvents: listenEvents(victim), configs, fetchSymbolData -}); +}); \ No newline at end of file From 8ce58b40053c383f6996916738f22b796df01f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Bragan=C3=A7a?= Date: Sun, 5 Apr 2020 11:48:38 -0300 Subject: [PATCH 2/3] Changed the challenge URL and updated the code Updated the challenge URL to the new one and implemented a condition to only allow voting option from 0 to 2. --- src/cli.js | 8 +++++++- src/config/contents.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cli.js b/src/cli.js index a5f41b7..f16be78 100644 --- a/src/cli.js +++ b/src/cli.js @@ -1,7 +1,13 @@ 'use strict'; require('dotenv/config'); -const getVictim = name => { +const getVictim = victim => { + + if ( victim >= 0 && victim <= 2 ) + { + return victim; + } + throw new Error('candidato invalido, use 0 | 1 | 2'); }; diff --git a/src/config/contents.js b/src/config/contents.js index 6381657..6c966f6 100644 --- a/src/config/contents.js +++ b/src/config/contents.js @@ -23,7 +23,7 @@ const links = { 'https://gshow.globo.com/realities/bbb/bbb20/votacao/paredao-bbb20-quem-voce-quer-eliminar-babu-gabi-ou-thelma-305135b8-b442-4cc8-888f-2a01ed79cc2d.ghtml', challengeUrl: 'https://captcha.globo.com/api/challenge/generate', challengeAcceptedUrl: - 'https://royale.globo.com/polls/8e81660d-89b5-4777-a324-6f2da878c5c7', + 'https://royale.globo.com/polls/d4846f06-6560-4991-a1a8-934a037bc1f3', mainApi: 'http://bots.heartdevs.com/' }; From 0edd81db15770379c0d9dd2d1e4231159af19daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Bragan=C3=A7a?= Date: Sun, 5 Apr 2020 23:38:48 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20para=20nova=20URL?= =?UTF-8?q?=20de=20vota=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli.js | 4 ++-- src/config/contents.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cli.js b/src/cli.js index f16be78..318c57f 100644 --- a/src/cli.js +++ b/src/cli.js @@ -12,7 +12,7 @@ const getVictim = victim => { }; module.exports = () => { - const victim = process.argv[2] || 'gabi'; + const victim = process.argv[2] || '2'; const email = process.argv[3] || process.env.EMAIL; const password = process.argv[4] || process.env.PASSWORD; @@ -26,7 +26,7 @@ module.exports = () => { console.log( `[❌] Erro: Comando invalido Utilize: node src/index.js [0 | 1 | 2] seu@email.com sua_senha - Exemplo: node src/index.js 1 eduardo@gmail.com minhasenha123` + Exemplo: node src/index.js 2 eduardo@gmail.com minhasenha123` .split('\n') .map(str => str.trim()) .join('\n') diff --git a/src/config/contents.js b/src/config/contents.js index 6c966f6..d0cff60 100644 --- a/src/config/contents.js +++ b/src/config/contents.js @@ -20,8 +20,7 @@ smmmmmdhhddo. \`/hmmmmmds- \`:. const links = { loginUrl: 'https://minhaconta.globo.com', voteUrl: - 'https://gshow.globo.com/realities/bbb/bbb20/votacao/paredao-bbb20-quem-voce-quer-eliminar-babu-gabi-ou-thelma-305135b8-b442-4cc8-888f-2a01ed79cc2d.ghtml', - challengeUrl: 'https://captcha.globo.com/api/challenge/generate', + 'https://gshow.globo.com/realities/bbb/bbb20/votacao/paredao-bbb20-quem-voce-quer-eliminar-babu-flayslane-ou-marcela-5ed83d00-014e-401d-80c8-20314769ce2f.ghtml', challengeAcceptedUrl: 'https://royale.globo.com/polls/d4846f06-6560-4991-a1a8-934a037bc1f3', mainApi: 'http://bots.heartdevs.com/' @@ -47,8 +46,8 @@ const users = [ /* BABU = 0 - GABI = 1 - THELMA = 2 + FLAY = 1 + MARCELA = 2 */ module.exports = {