Site icon WDN

..

..
.. <![CDATA[ (function(){ var prevLivetime = -1; setInterval(function() { var captchaImageLivetime = Math.floor((Date.now() - captchaImageReceivedAt) / 1000); if (prevLivetime!=captchaImageLivetime) { var critical = Math.floor(CAPTCHA_ENV["VERIFICATION_TOKEN_TTL"]/1000); if (prevLivetime!==-1 && prevLivetimecritical) { expireSoon(); } prevLivetime = captchaImageLivetime; } }, 0.5*1000); })(); ]]> { if (loadings===0) { document.body.classList.remove(‘state-loading’); document.getElementById(“answerbtn”).disabled = false; document.getElementById(“answer”).focus(); document.getElementById(“answer”).value = “”; document.getElementById(“refreshbtn”).disabled = false; document.getElementById(“answerbtn”).disabled = false; } }, 50); } function actualOrDefault(replacedVariable, defaultValue) { if (replacedVariable.charAt(0)==”_”) { if (replacedVariable.charAt(replacedVariable.length-1)==”_”) { return defaultValue; } } return replacedVariable; } var CAPTCHA_ENV = { “REQUEST_ID”: “tVTgic0ff4Y1”, “IP”: “103.115.8.123”, “DATETIME”: “2024-11-12 07:31:55 +0000”, “ORIGINAL_URL”: “https://antikor.com.ua/articles/733956-v_harjkove_ustranjajut_posledstvija_nochnyh_priletov&#8221;, “PTOKEN_PARAM_NAME_FOR_ORIGINAL_URL”: “fa821dba_ipp_har”, “CAPTCHA_TOKEN”: actualOrDefault(“twlCEuwRAUwG8MozOMEn4tELgcgLTSWOfkw/WwQ5iP6Y2RqECD5MIQewqLRGftH16NphOw==”,””), “CAPTCHA_TOKEN_TTL”: actualOrDefault(“600000”, “600000”)*1, “VERIFICATION_TOKEN_TTL”: actualOrDefault(“120000”, “120000”)*1, “CAPTCHA_URL”: actualOrDefault(“https://c2.vchecks.io&#8221;,””), }; var captchaImageReceivedAt = 0; var vtoken = null; function myFetch(folder, params) { if (folder.charAt(0)==”/”) folder = folder.slice(1); var origin = CAPTCHA_ENV[“CAPTCHA_URL”]; if (origin.slice(-1)==”/”) origin = origin.slice(0, -1); var url = origin + “/” + folder; url += “?ms=”+ Date.now() +”&rnd=” + Math.random(); url += “&ctoken=” + CAPTCHA_ENV[“CAPTCHA_TOKEN”]; var getParams = Object.entries(params || {}).map(([k,v]) => k+’=’+v).join(‘&’) || ”; if (getParams) { url += ‘&’ + getParams; } return fetch(url) .then(res => { if (!res.ok) throw new Error(url +’ return ‘+ res.status); return res.json(); }); } function fetchPic() { addLoading(); document.getElementById(“captcha”).src = ”; document.body.classList.remove(“state-expire-wait-for-user”); var widthAsCaptcha = () => { setTimeout(()=>{ var img = document.getElementById(“captcha”); img.width = img.naturalWidth; img.height = img.naturalHeight; var width = img.offsetWidth; var height = img.offsetHeight; Array.from(document.querySelectorAll(“.width-as-captcha”)).forEach(node => { node.style.width = width +”px”; }); Array.from(document.querySelectorAll(“.height-as-captcha”)).forEach(node => { node.style.height = height +”px”; }); console.log(width, height) notExpireSoon(); setTimeout(()=>{ document.body.classList.remove(“first-captcha-not-loaded”); document.body.classList.add(“first-captcha-loaded”); }, 50); },10); } document.getElementById(“captcha”).onload = widthAsCaptcha; return myFetch(“generate”, null) .then(json => { var captcha_image_elem = document.getElementById(“captcha”); if (json.png) { captcha_image_elem.src = “data:image/png;base64,” + json.png; } else if (json.jpg || json.jpeg) { captcha_image_elem.src = “data:image/jpeg;base64,” + json.jpg || json.jpeg; } if (json.alt) { captcha_image_elem.alt = json.alt; } captcha_image_elem.classList.remove(‘loading’); vtoken = json.vtoken; captchaImageReceivedAt = Date.now(); removeLoading(); }) .catch(er => { console.error(er); widthAsCaptcha(); return new Promise(resolve => { setTimeout(() => { resolve(); }, 5 * 1000); }) .then(()=>{ removeLoading(); return fetchPic(); }); }); } function expireSoon() { document.body.classList.add(‘state-expire’); document.body.classList.add(‘state-expire-wait-for-user’); document.getElementById(“answerbtn”).disabled = true; document.getElementById(“refreshbtn”).disabled = false; document.getElementById(“answer”).disabled = true; } function notExpireSoon() { document.body.classList.remove(‘state-expire’); document.body.classList.remove(‘state-expire-wait-for-user’); document.getElementById(“answerbtn”).disabled = false; document.getElementById(“answer”).disabled = false; } function submit_answer() { addLoading(); return myFetch(“verify”, {“vtoken”: vtoken, “answer”: (document.getElementById(“answer”).value+”).trim()}) .then(json => { const result_url = new URL(CAPTCHA_ENV[“ORIGINAL_URL”]); result_url.searchParams.append(CAPTCHA_ENV[“PTOKEN_PARAM_NAME_FOR_ORIGINAL_URL”], json.ptoken); window.location.href = result_url.href; }) .catch(er => { console.error(er); return new Promise(resolve => { setTimeout(() => { resolve(); }, 1 * 1000); }) .then(()=>{ removeLoading(); document.body.classList.add(‘state-wrong-answer’); setTimeout(() => { document.body.classList.remove(‘state-wrong-answer’); }, 3*1000); return fetchPic(); }); }) } removeLoading(); fetchPic(); setTimeout(()=>{ document.getElementById(“answerbtn”).disabled = true; document.getElementById(“refreshbtn”).disabled = false; document.getElementById(“answer”).disabled = true; document.getElementById(“refreshbtn”).onclick = () => window.location.reload(); }, CAPTCHA_ENV[“CAPTCHA_TOKEN_TTL”]) ]]>

Exit mobile version