await WaitForLoading();
await Delay(1000);
var sitekey = await EvaluateScript('var s = document.getElementById("captchaShortlink").getElementsByTagName("iframe")[0].src; var start=s.indexOf("&k="); var end = s.indexOf("&", start+3); s.substr(start+3, end-start-3);');
var pageUrl = await EvaluateScript('window.location.href');
//Alert(sitekey + " - " + pageUrl);
var result = await _2CaptchaSolve({
'key' : 'YOUR_API_KEY',
'method' : 'userrecaptcha',
'json' : 1,
'googlekey': sitekey,
'pageurl' : pageUrl
}, 300);
SetById("g-recaptcha-response", "text", result.request);
ExecuteScript('var btn = document.getElementById("invisibleCaptchaShortlink"); btn.removeAttribute("disabled"); btn.click()');
await Delay(5000);
var itv = setInterval(function(){
ExecuteScript('if(document.body.onfocus) document.body.onfocus()');
},1000);
while(await EvaluateScript('var gl = document.getElementsByClassName("get-link")[0];!gl || gl.classList.contains("disabled") ? true : false'))
{
await Delay(1000);
}
ClickByClass("get-link");
clearInterval(itv);