I got a javascript that solves captchas using 2captcha. There is first a function defined, than i call it to send GET request.
It works fine in chrome console, but in zenno it just ticks of positive end without doing any work.
It works fine in chrome console, but in zenno it just ticks of positive end without doing any work.
Код:
var apiKey = "API";
var googleKey = ___grecaptcha_cfg.clients[0].aa.l.sitekey;
var pageUrl = ___grecaptcha_cfg.clients[0].$a.baseURI;
function httpGet(theUrl){
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
return xmlHttp.responseText;
}
function sendCaptcha(){
var keyCaptchaParams = "https://2captcha.com/in.php?key=" + apiKey + "&method=userrecaptcha" + "&googlekey=" + googleKey + "&pageurl=" + pageUrl + "&header_acao=1&json=1";
var captchaId = JSON.parse(httpGet(keyCaptchaParams)).request;
var keyCaptchaResponse = "https://2captcha.com/res.php?key=" + apiKey + "&action=get&header_acao=1&json=1&id=" + captchaId;
var intId = setInterval(function(){
var captchaAnswer = JSON.parse(httpGet(keyCaptchaResponse));
console.log(captchaAnswer);
if ( captchaAnswer.status === 1 ) {
clearInterval(intId);
var answer = captchaAnswer.request;
document.getElementById('g-recaptcha-response').innerHTML=answer;
// onSuccess(answer);
document.getElementById('captcha-submit').click();
}
else if ( captchaAnswer.request === "ERROR_CAPTCHA_UNSOLVABLE" ) {
clearInterval(intId);
console.log("Captcha is unsolvable");
}
},5000);
}