fix: handle epic login captcha manually in legacy/new flows
This commit is contained in:
parent
728d08e551
commit
37de92c92e
2 changed files with 11 additions and 20 deletions
|
|
@ -104,27 +104,18 @@ try {
|
|||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
// If captcha or "Incorrect response" is visible, do not auto-submit; wait for manual solve.
|
||||
const hasCaptcha = await page.locator('.h_captcha_challenge iframe, text=Incorrect response').count() > 0;
|
||||
if (hasCaptcha) {
|
||||
console.warn('Captcha/Incorrect response detected. Please solve manually in the browser.');
|
||||
await notify('epic-games: captcha encountered; please solve manually in browser.');
|
||||
await page.waitForTimeout(cfg.login_timeout);
|
||||
continue;
|
||||
}
|
||||
|
||||
const email = cfg.eg_email || await prompt({ message: 'Enter email' });
|
||||
if (email) {
|
||||
const watchCaptchaChallenge = async () => {
|
||||
try {
|
||||
await page.waitForSelector('.h_captcha_challenge iframe', { timeout: 15000 });
|
||||
console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.');
|
||||
await notify('epic-games: got captcha during login. Please check.');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
};
|
||||
const watchCaptchaIncorrect = async () => {
|
||||
try {
|
||||
await page.waitForSelector('p:has-text("Incorrect response.")', { timeout: 15000 });
|
||||
console.error('Incorrect response for captcha!');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
};
|
||||
watchCaptchaChallenge();
|
||||
watchCaptchaIncorrect();
|
||||
await page.fill('#email', email);
|
||||
const password = cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' });
|
||||
if (password) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue