Skip to content

Commit afae8c3

Browse files
committed
eg: skip checking already claimed games for current user
1 parent bea9020 commit afae8c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

epic-games.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ try {
161161

162162
for (const url of urls) {
163163
if (cfg.time) console.time('claim game');
164+
if (db.data[user][url.split('/').pop()]?.status == 'claimed') {
165+
console.log('Already claimed, skipping:', url);
166+
continue;
167+
}
164168
await page.goto(url); // , { waitUntil: 'domcontentloaded' });
165169
// when loading, the button text is empty -> need to wait for some text {'get', 'in library', 'requires base game'} -> just wait for e or i to not be too specific; :text-matches("\w+") somehow didn't work - https://github.com/vogler/free-games-claimer/issues/375
166170
// was using locator('...').first().waitFor(), but that at some point led to exception locator.waitFor: Error: Can't query n-th element

0 commit comments

Comments
 (0)