Fixed too strong captcha detection

This commit is contained in:
2026-02-14 22:49:05 +01:00
parent 8725f4ddde
commit ddb712ba4a
4 changed files with 31 additions and 33 deletions
+8 -4
View File
@@ -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`);
}
}