Fixed too strong captcha detection
This commit is contained in:
+8
-4
@@ -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`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user