pg: skip if user has no Prime membership, closes #76?
This commit is contained in:
parent
dc28c30e7b
commit
cc39b4b3d1
1 changed files with 6 additions and 0 deletions
|
|
@ -85,6 +85,12 @@ try {
|
|||
// console.log(`Twitch user name is ${twitch}`);
|
||||
db.data[user] ||= {};
|
||||
|
||||
if (await page.getByRole('button', { name: 'Try Prime' }).count()) {
|
||||
console.error('User is currently not an Amazon Prime member, so no games to claim. Exit!');
|
||||
await context.close();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await page.click('button[data-type="Game"]');
|
||||
const games_sel = 'div[data-a-target="offer-list-FGWP_FULL"]';
|
||||
await page.waitForSelector(games_sel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue