Skip to content

Commit d5072a6

Browse files
Fix gog error per @jordyamc
#398 (comment)
1 parent c8cf736 commit d5072a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gog.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ try {
9999
console.log('Currently no free giveaway!');
100100
} else {
101101
const text = await page.locator('.giveaway__content-header').innerText();
102-
const title = text.match(/Claim (.*) and don't miss the/)[1];
102+
const match_all = text.match(/Claim (.*) and don't miss the|Success! (.*) was added to/);
103+
const title = match_all[1] ? match_all[1] : match_all[2];
103104
const url = await banner.locator('a').first().getAttribute('href');
104105
console.log(`Current free game: ${title} - ${url}`);
105106
db.data[user][title] ||= { title, time: datetime(), url };

0 commit comments

Comments
 (0)