Skip to content

Commit

Permalink
Merge pull request #1 from AgentTechnoman/main
Browse files Browse the repository at this point in the history
Fix gog error per @jordyamc
  • Loading branch information
dniedermeyer authored Dec 21, 2024
2 parents d0dbf76 + d5072a6 commit 0b47ae5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gog.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ try {
console.log('Currently no free giveaway!');
} else {
const text = await page.locator('.giveaway__content-header').innerText();
const title = text.match(/Claim (.*) and don't miss the/)[1];
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}`);
db.data[user][title] ||= { title, time: datetime(), url };
Expand Down

0 comments on commit 0b47ae5

Please sign in to comment.