From 728d08e551799b03b4cd89f5ea80e62cd191cc61 Mon Sep 17 00:00:00 2001 From: nocci Date: Wed, 31 Dec 2025 13:33:49 +0000 Subject: [PATCH 1/2] fix: retry continue/submit on epic password and otp steps --- epic-claimer-new.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/epic-claimer-new.js b/epic-claimer-new.js index fbc212a..313892e 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -140,7 +140,9 @@ const ensureLoggedIn = async (page, context) => { await passwordField.fill(cfg.eg_password); const rememberMe = page.locator('input[name="rememberMe"], #rememberMe'); if (await rememberMe.count()) await rememberMe.check().catch(() => {}); - await page.click('button[type="submit"]'); + await continueBtn.first().click().catch(async () => { + await page.click('button[type="submit"]').catch(() => {}); + }); // MFA step try { @@ -156,7 +158,9 @@ const ensureLoggedIn = async (page, context) => { } else { await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); } - await page.click('button[type="submit"]'); + await continueBtn.first().click().catch(async () => { + await page.click('button[type="submit"]').catch(() => {}); + }); } catch { // no MFA } From 37de92c92ee852db7473c7e182f3b81add4feb2e Mon Sep 17 00:00:00 2001 From: nocci Date: Wed, 31 Dec 2025 13:50:14 +0000 Subject: [PATCH 2/2] fix: handle epic login captcha manually in legacy/new flows --- epic-claimer-new.js | 2 +- epic-games.js | 29 ++++++++++------------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/epic-claimer-new.js b/epic-claimer-new.js index 313892e..3943fc6 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -125,7 +125,7 @@ const ensureLoggedIn = async (page, context) => { if (!cfg.eg_email || !cfg.eg_password) return false; try { await page.goto('https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=' + URL_CLAIM, { waitUntil: 'domcontentloaded' }); - const emailField = page.locator('input[name="email"], input#email'); + const emailField = page.locator('input[name="email"], input#email, input[aria-label="Sign in with email"]'); const passwordField = page.locator('input[name="password"], input#password'); const continueBtn = page.locator('button:has-text("Continue"), button#continue, button[type="submit"]'); diff --git a/epic-games.js b/epic-games.js index ce14eab..a22a873 100644 --- a/epic-games.js +++ b/epic-games.js @@ -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) {