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; +