diff --git a/failed_sites.txt b/failed_sites.txt index e8e4f2a..4926311 100644 --- a/failed_sites.txt +++ b/failed_sites.txt @@ -1,19 +1,8 @@ DATE | TIME | WEBSITE | REASON ---------------------------------------------------------------------------------------------------- -14/02/2026 | 20:31:58 | Site_3 (https://kulalaland.com/) | No email field detected -14/02/2026 | 20:42:16 | Dutch News Test (https://www.dut | CAPTCHA present: reCAPTCHA -14/02/2026 | 20:43:17 | Site_1 (https://www.dutchnews.nl | CAPTCHA present: reCAPTCHA -14/02/2026 | 20:43:17 | Site_3 (https://kulalaland.com/) | No email field detected -14/02/2026 | 20:45:19 | Site_1 (https://www.dutchnews.nl | CAPTCHA present: reCAPTCHA -14/02/2026 | 20:45:19 | Site_2 (https://immaculatevegan. | Not a newsletter signup form -14/02/2026 | 20:45:19 | Site_3 (https://kulalaland.com/) | No email field detected -14/02/2026 | 20:46:06 | Site_1 (https://www.dutchnews.nl | CAPTCHA present: reCAPTCHA -14/02/2026 | 20:46:06 | Site_3 (https://kulalaland.com/) | No email field detected -14/02/2026 | 21:26:47 | Dutch News Test (https://www.dut | Navigating frame was detached -14/02/2026 | 21:26:47 | Immaculate Vegan (https://immacu | Connection closed. -14/02/2026 | 21:26:47 | Gate6 (https://gate6.vn/) | Connection closed. -14/02/2026 | 21:26:47 | Kulala Land (https://kulalaland. | Connection closed. -14/02/2026 | 21:26:47 | sneakywholefoods (https://www.sn | Connection closed. -14/02/2026 | 21:27:40 | Dutch News Test (https://www.dut | CAPTCHA present: reCAPTCHA -14/02/2026 | 21:27:40 | Kulala Land (https://kulalaland. | No email field detected -14/02/2026 | 21:27:40 | sneakywholefoods (https://www.sn | Not a newsletter signup form +14/02/2026 | 22:41:09 | Dutch News Test (https://www.dut | CAPTCHA present: reCAPTCHA +14/02/2026 | 22:41:09 | Kulala Land (https://kulalaland. | No email field detected +14/02/2026 | 22:41:09 | sneakywholefoods (https://www.sn | Not a newsletter signup form +14/02/2026 | 22:46:37 | Gate6 (https://gate6.vn/) | Navigating frame was detached +14/02/2026 | 22:46:37 | Kulala Land (https://kulalaland. | Navigating frame was detached +14/02/2026 | 22:46:37 | sneakywholefoods (https://www.sn | Connection closed. diff --git a/sites.txt b/sites.txt deleted file mode 100644 index a1de280..0000000 --- a/sites.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Newsletter signup sites -# Lines starting with # are ignored - -https://www.dutchnews.nl/dutchnews-newsletter-signup/ -https://immaculatevegan.com/blogs/magazine -https://kulalaland.com/ \ No newline at end of file diff --git a/src/captcha.js b/src/captcha.js index 92dee14..0b154f2 100644 --- a/src/captcha.js +++ b/src/captcha.js @@ -31,12 +31,23 @@ async function detectCaptcha(page) { for (const selector of config.selectors) { const elements = document.querySelectorAll(selector); if (elements.length > 0) { - results.push({ - type: type, - name: config.name, - selector: selector, - count: elements.length - }); + for (const el of elements) { + const style = window.getComputedStyle(el); + const rect = el.getBoundingClientRect(); + const isVisible = style.display !== 'none' && + style.visibility !== 'hidden' && + style.opacity !== '0' && + rect.width > 0 && + rect.height > 0; + + results.push({ + type: type, + name: config.name, + selector: selector, + count: elements.length, + isVisible: isVisible + }); + } break; } } diff --git a/src/processor.js b/src/processor.js index 56df9d4..aaf2bae 100644 --- a/src/processor.js +++ b/src/processor.js @@ -37,7 +37,8 @@ async function processSite(browser, site, globalCreds, browserConfig, keepOpen = if (captchaInfo.length > 0) { console.log(`\n CAPTCHA DETECTED:`); for (const captcha of captchaInfo) { - console.log(` - ${captcha.name}`); + const visibility = captcha.isVisible ? '(visible)' : '(hidden)'; + console.log(` - ${captcha.name} ${visibility}`); } if (captchaInfo.some(c => c.type === 'mathCaptcha')) { @@ -77,11 +78,14 @@ async function processSite(browser, site, globalCreds, browserConfig, keepOpen = } } - if (captchaInfo.some(c => c.type === 'recaptcha' || c.type === 'hcaptcha')) { + const visibleRecaptcha = captchaInfo.filter(c => (c.type === 'recaptcha' || c.type === 'hcaptcha') && c.isVisible); + if (visibleRecaptcha.length > 0) { siteFailed = true; - failureReason = `CAPTCHA present: ${captchaInfo.map(c => c.name).join(', ')}`; - console.error(` Cannot auto-solve ${captchaInfo.map(c => c.name).join(', ')}`); + failureReason = `CAPTCHA present: ${visibleRecaptcha.map(c => c.name).join(', ')}`; + console.error(` Cannot auto-solve ${visibleRecaptcha.map(c => c.name).join(', ')}`); return { siteFailed, failureReason, page }; + } else if (captchaInfo.some(c => c.type === 'recaptcha' || c.type === 'hcaptcha')) { + console.log(` CAPTCHA detected but not visible - attempting to proceed anyway`); } }