diff --git a/README.md b/README.md index e845c62..af2a19b 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Available options/variables and their default values: | PG_CLAIMDLC | 0 | Prime Gaming: try to claim DLCs ([experimental](https://github.com/vogler/free-games-claimer/issues/55)). | | GOG_EMAIL | | GOG email for login. Overrides EMAIL. | | GOG_PASSWORD | | GOG password for login. Overrides PASSWORD. | +| GOG_NEWSLETTER | 0 | Do not unsubscribe from newsletter after claiming a game if 1. | See `config.js` for all options. diff --git a/config.js b/config.js index c667040..33016ca 100644 --- a/config.js +++ b/config.js @@ -34,6 +34,7 @@ export const cfg = { // auth gog gog_email: process.env.GOG_EMAIL || process.env.EMAIL, gog_password: process.env.GOG_PASSWORD || process.env.PASSWORD, + gog_newsletter: process.env.GOG_NEWSLETTER == '1', // do not unsubscribe from newsletter after claiming a game // OTP only via GOG_EMAIL, can't add app... // experimmental - likely to change diff --git a/gog.js b/gog.js index feffa70..4e27cc2 100644 --- a/gog.js +++ b/gog.js @@ -128,7 +128,7 @@ try { db.data[user][title].status ||= status; notify_games.push({ title, url, status }); - if (status == 'claimed') { + if (status == 'claimed' && !cfg.gog_newsletter) { console.log("Unsubscribe from 'Promotions and hot deals' newsletter"); await page.goto('https://www.gog.com/en/account/settings/subscriptions'); await page.locator('li:has-text("Promotions and hot deals") label').uncheck();