-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Captcha validation issue #1
Comments
Here the piece of code who archieve this :
|
@SPYNARY Could you tell me the address of the page with the captcha, and the algorithm for how to get it? |
Sure here it is : |
I tried some manipulation and i think it may be possible to trick the page because the verification seem to be done on the client side |
And if you want to fidn this you have to type sitekey in dev tool element |
I also found in mtcaptcha documentation the mentionned part : |
I also had an issue with your package idk why but it was returning an unsolvable error so i built my own using v2 api : async function waitForTaskCompletion(clientKey, taskId) {
while (true) {
try {
const res = await axios.post("https://api.2captcha.com/getTaskResult", {
"clientKey": clientKey,
"taskId": taskId
});
if (res.data.status === "ready") {
console.log('Solution found');
return res.data.solution;
} else if (res.data.status === "processing") {
console.log('In process, retry');
await new Promise(resolve => setTimeout(resolve, 5000));
} else {
console.log('Solution search failed');
throw new Error(`Error ${res.data.errorId}: ${res.data.errorDescription}`);
}
} catch (error) {
throw error;
}
}
}
const res = await axios.post("https://api.2captcha.com/createTask", {
"clientKey": "",
"task": {
"type": "MtCaptchaTaskProxyless",
"websiteURL": "https://top-serveurs.net/rdr/vote/last-red-line",
"websiteKey": mtCaptchaKey
}
});
const solution = await waitForTaskCompletion('', res.data.taskId);
const captchaAnswer = solution.token; |
@SPYNARY Hi. I checked the MTcaptcha solution on this site using Sites can add additional protection methods, such as |
@SPYNARY The easiest way is to use a different method of solving the captcha. Try using the Normal captcha method. To do this, you just need to take a screenshot of the captcha task and send it to the service, then the service will return the text from the image to you. After that, you will only have to enter the text in the text field. And then click on the required button. Since the text in the task is case-sensitive, it is advisable to send an additional parameter |
Okay perfect thank's a lot, that blow my mind since 1 day XD |
@SPYNARY Hi again, I made a simple demo, it works for me, but apparently you also need to use a proxy, since the number of votes is tied to the ip. Demo: import puppeteer from "puppeteer";
import { Solver } from "2captcha-ts";
const solver = new Solver("you_2captcha_api_key");
const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
(async () => {
const browser = await puppeteer.launch({
headless: false,
devtools: true
});
const [page] = await browser.pages();
await page.setViewport({ width: 1080, height: 1024 });
// Open target page that contains MTCaptcha.
await page.goto("https://top-serveurs.net/rdr/vote/last-red-line");
// show sometimes, depends on ip
// await page.waitForSelector(".fc-consent-root");
// await page.waitForSelector(".fc-cta-consent .fc-button-label");
// await page.click('.fc-cta-consent .fc-button-label')
await page.type('#playername', 'user3d3dd')
await page.waitForSelector("#mtcaptcha-iframe-1");
// Getting the frame
const iframeElementHandle = await page.$("#mtcaptcha-iframe-1");
const iframe = await iframeElementHandle.contentFrame();
// Wait
await sleep(2000);
// Grab captcha image(`base64`)
const captcha = await iframe.evaluate(() => {
console.log(document.querySelector('.mtcap-image img'))
const captcha = document.querySelector('.mtcap-image img').src
console.log(captcha)
return captcha
});
// Wait
await sleep(3000)
// console.log(captcha)
// solve image captcha
const res = await solver.imageCaptcha({
body: captcha,
regsense: 1
});
console.log("Answer:");
console.log(res);
const frameHandle = await page.$("#mtcaptcha-iframe-1");
const frame = await frameHandle.contentFrame();
await frame.click('#mtcap-inputtext-1')
// type captcha answer
await frame.type('#mtcap-inputtext-1', res.data)
await sleep(3000)
// click submit btn
await page.click('button[type="submit"]')
})(); |
@SPYNARY Please check or this method works for you. |
It work, thanks ;) |
Hi, im facing an issue who block your code to submit the solution token, i have try multiple way to avoid this but the issue persist.
The thing is that the submit button of the website is enabled only when the MTCaptcha is completed by typing the right code, but when the code solve it using the solution token it doesn't enable this button , i have tried to remove the disabled attribute of the buton but i still get the error 'Please fill the captcha correctly'
The text was updated successfully, but these errors were encountered: