Skip to content

Commit

Permalink
Merge pull request #325 from Tymec/main
Browse files Browse the repository at this point in the history
Ability to use a different email for Legacy Games
  • Loading branch information
vogler authored Jun 25, 2024
2 parents c0eb6db + afceb0a commit 357a780
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Available options/variables and their default values:
| 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. |
| LG_EMAIL | | Legacy Games: email to use for redeeming (if not set, defaults to PG_EMAIL) |

See `src/config.js` for all options.

Expand Down
4 changes: 2 additions & 2 deletions prime-gaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ try {
}
} else if (store == 'legacy games') {
await page2.fill('[name=coupon_code]', code);
await page2.fill('[name=email]', cfg.pg_email); // TODO option for sep. email?
await page2.fill('[name=email_validate]', cfg.pg_email);
await page2.fill('[name=email]', cfg.lg_email);
await page2.fill('[name=email_validate]', cfg.lg_email);
await page2.uncheck('[name=newsletter_sub]');
await page2.click('[type="submit"]');
try {
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const cfg = {
xbox_otpkey: process.env.XBOX_OTPKEY,
// experimmental
pg_redeem: process.env.PG_REDEEM == '1', // prime-gaming: redeem keys on external stores
lg_email: process.env.LG_EMAIL || process.env.PG_EMAIL || process.env.EMAIL, // prime-gaming: external: legacy-games: email to use for redeeming
pg_claimdlc: process.env.PG_CLAIMDLC == '1', // prime-gaming: claim in-game content
pg_timeLeft: process.env.PG_TIMELEFT == '1', // prime-gaming: list time left to claim
};

0 comments on commit 357a780

Please sign in to comment.