dev #1

Merged
nocci merged 51 commits from dev into main 2026-03-06 16:31:29 +01:00
Showing only changes of commit 1c34648112 - Show all commits

View file

@ -148,6 +148,12 @@ const ensureLoggedIn = async (page, context) => {
}
};
const isChallenge = async () => {
const cfFrame = page.locator('iframe[title*="Cloudflare"], iframe[src*="challenges"]');
const cfText = page.locator('text=Verify you are human');
return (await cfFrame.count()) > 0 || (await cfText.count()) > 0;
};
while (!await isLoggedIn()) {
console.error('Not signed in anymore. Trying automatic login, otherwise please login in the browser.');
if (cfg.novnc_port) console.info(`Open http://localhost:${cfg.novnc_port} to login inside the docker container.`);
@ -155,6 +161,13 @@ const ensureLoggedIn = async (page, context) => {
console.info(`Login timeout is ${cfg.login_timeout / 1000} seconds!`);
await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' });
if (await isChallenge()) {
console.warn('Cloudflare challenge detected. Solve the captcha in the browser (no automation).');
await notify('epic-games (new): Cloudflare challenge, please solve manually in browser.');
await page.waitForTimeout(cfg.login_timeout);
continue;
}
const logged = await attemptAutoLogin();
if (logged) break;