From af90aa7c42d04c52ea3ecbeafc950bc869901e16 Mon Sep 17 00:00:00 2001 From: nocci Date: Thu, 8 Jan 2026 15:27:19 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(epic-claimer):=20?= =?UTF-8?q?enhance=20screenshot=20path=20resolution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - improve screenshot path by using path.resolve for better cross-platform compatibility - organize screenshots into a structured directory hierarchy --- epic-claimer-new.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epic-claimer-new.js b/epic-claimer-new.js index 694f25a..b9943fd 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -15,6 +15,7 @@ import { } from './src/util.js'; import { cfg } from './src/config.js'; + const URL_CLAIM = 'https://store.epicgames.com/en-US/free-games'; const COOKIES_PATH = path.resolve(cfg.dir.browser, 'epic-cookies.json'); const BEARER_TOKEN_NAME = 'EPIC_BEARER_TOKEN'; @@ -292,8 +293,8 @@ const claimGame = async (page, game) => { notify_game.status = 'claimed'; } catch (e) { notify_game.status = 'failed'; - const p = screenshot('failed', `${game.offerId || game.pageSlug}_${filenamify(datetime())}.png`); - await page.screenshot({ path: p, fullPage: true }).catch(() => { }); + const screenshotPath = path.resolve(cfg.dir.screenshots, 'epic-games', 'failed', `${game.offerId || game.pageSlug}_${filenamify(datetime())}.png`); + await page.screenshot({ path: screenshotPath, fullPage: true }).catch(() => { }); console.error(' Failed to claim:', e.message); } @@ -378,3 +379,4 @@ export const claimEpicGamesNew = async () => { }; export default claimEpicGamesNew; +