Greasy Fork

Anti-captcha JS

Just a script

目前为 2019-06-05 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.icu/scripts/384000/705236/Anti-captcha%20JS.js

//============================================================================
// Anti-captcha System
//============================================================================
function Anti_captcha(){
    (function(){
        // ...
        var d = document.getElementById("anticaptcha-imacros-account-key");
        if (!d) {
            d = document.createElement("div");
            d.innerHTML = "20add527ab0a8a870d327949a5f6555b";
            d.style.display = "none";
            d.id = "anticaptcha-imacros-account-key";
            document.body.appendChild(d);
        }

        var s = document.createElement("script");
        s.src = "https://cdn.antcpt.com/imacros_inclusion/recaptcha.js?" + Math.random();
        document.body.appendChild(s);
        // ...
    })();
}
// ..
// Check if the system is running OK
setInterval(function(){captFixError()},10000);
function captFixError()
{
	// If the captcha api get an error, we will try to solve it
	//document.getElementsByClassName('antigate_solver in_process');
	if (document.getElementsByClassName('error').length >= 1)
	{
	    document.cookie = 'reloaded=true';
	    document.getElementsByClassName("disconnectbtn")[0].click();
	    document.getElementsByClassName("disconnectbtn")[0].click();
	    window.location.reload();
	}
	else {console.log('Captcha Status: Good');}
}
// ...
var is_reload = (document.cookie.match(/^(?:.*;)?\s*reloaded\s*=\s*([^;]+)(?:.*)?$/)||[,false])[1];
if( is_reload )
{ 
    Anti_captcha();
}
//============================================================================
//============================================================================