Current free game title in blue
This commit is contained in:
parent
04d1b7ea9e
commit
726db4527b
3 changed files with 8 additions and 6 deletions
3
gog.js
3
gog.js
|
|
@ -1,4 +1,5 @@
|
|||
import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra
|
||||
import chalk from 'chalk';
|
||||
import { resolve, jsonDb, datetime, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js';
|
||||
import { cfg } from './src/config.js';
|
||||
|
||||
|
|
@ -102,7 +103,7 @@ try {
|
|||
const match_all = text.match(/Claim (.*) and don't miss the|Success! (.*) was added to/);
|
||||
const title = match_all[1] ? match_all[1] : match_all[2];
|
||||
const url = await banner.locator('a').first().getAttribute('href');
|
||||
console.log(`Current free game: ${title} - ${url}`);
|
||||
console.log(`Current free game: ${chalk.blue(title)} - ${url}`);
|
||||
db.data[user][title] ||= { title, time: datetime(), url };
|
||||
if (cfg.dryrun) process.exit(1);
|
||||
// await page.locator('#giveaway:not(.is-loading)').waitFor(); // otherwise screenshot is sometimes with loading indicator instead of game title; #TODO fix, skipped due to timeout, see #240
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue