"; // DEBUG: imagem captcha (raw) const PHP_CAPTCHA_IMAGE_AD = "\r\n\r\n"; console.log('[CAPTCHA] ADS_DISABLED_SERVER:', ADS_DISABLED_SERVER); console.log('[CAPTCHA] PHP ad_captcha_message (raw):', PHP_AD_MESSAGE); console.log('[CAPTCHA] PHP message length:', (PHP_AD_MESSAGE || '').length); console.log('[CAPTCHA] PHP captcha_image_ad (raw):', PHP_CAPTCHA_IMAGE_AD); console.log('[CAPTCHA] captcha_image_ad length:', (PHP_CAPTCHA_IMAGE_AD || '').length); function stripRedirects() { document.querySelectorAll('meta[http-equiv="refresh" i]').forEach(m => m.remove()); document.querySelectorAll('.banner meta[http-equiv="refresh" i]').forEach(m => m.remove()); document.querySelectorAll('.banner script').forEach(s => s.remove()); document.querySelectorAll('.banner *').forEach(el => { for (const a of [...el.attributes]) { if (/^on[a-z]+$/i.test(a.name)) el.removeAttribute(a.name); } }); } function hideAdsUi(reason) { console.warn('[CAPTCHA] Hiding ads UI. reason:', reason); document.querySelectorAll('.banner').forEach(el => el.style.display = 'none'); const msg = document.getElementById('ads-message'); if (msg) msg.style.display = 'none'; } if (ADS_DISABLED_SERVER) { hideAdsUi('server_adsDisabled'); stripRedirects(); return; } fetch('https://api.encurta.net/', { credentials: 'include' }) .then(r => { console.log('[CAPTCHA] API status:', r.status); return r.json(); }) .then(data => { console.log('[CAPTCHA] API response:', data); if (data && typeof data.message !== 'undefined') { console.log('[CAPTCHA] API message:', data.message); } if (data && (data.disable_ads === 1 || data.disable_ads === true)) { hideAdsUi('api_disable_ads'); stripRedirects(); } }) .catch(err => { console.warn('[CAPTCHA] API fetch error:', err); }); })();