From 08da100646edac2d8fa2b95bbb2b2ec55cc5ad43 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 28 Aug 2022 20:28:56 +0100 Subject: [PATCH] no : in filenames on Windows! closes #21, ref #20 --- epic-games.js | 2 +- prime-gaming.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epic-games.js b/epic-games.js index 07ed9c5..4bc9a82 100644 --- a/epic-games.js +++ b/epic-games.js @@ -109,7 +109,7 @@ try { console.log('Claimed successfully!'); } catch (e) { console.log(e); - const p = path.resolve(dirs.screenshots, 'epic-games', `${datetime()}.png`); + const p = path.resolve(dirs.screenshots, 'epic-games', `${datetime().replaceAll(':', '.')}.png`); await page.screenshot({ path: p, fullPage: true }); console.info('Saved a screenshot of hcaptcha challenge to', p); console.error('Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility'); // TODO save this link in config and visit it daily to set accessibility cookie to avoid captcha challenge? diff --git a/prime-gaming.js b/prime-gaming.js index 4999449..8a87a17 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -132,7 +132,7 @@ try { await page.goto(URL_CLAIM, {waitUntil: 'domcontentloaded'}); await page.click('button[data-type="Game"]'); } while (n); - const p = path.resolve(dirs.screenshots, 'prime-gaming', `${datetime()}.png`); + const p = path.resolve(dirs.screenshots, 'prime-gaming', `${datetime().replaceAll(':', '.')}.png`); // await page.screenshot({ path: p, fullPage: true }); await page.locator(games_sel).screenshot({ path: p }); } catch(error) {