eg: add EG_PARENTALPIN to enter Parental Controls PIN, #98

This commit is contained in:
Ralf Vogler 2023-03-17 11:19:38 +01:00
parent 9435ff6edb
commit b75f538d8a
3 changed files with 12 additions and 1 deletions

View file

@ -76,6 +76,7 @@ Available options/variables and their default values:
| EG_EMAIL | | Epic Games email for login. Overrides EMAIL. |
| EG_PASSWORD | | Epic Games password for login. Overrides PASSWORD. |
| EG_OTPKEY | | Epic Games MFA OTP key. |
| EG_PARENTALPIN | | Epic Games Parental Controls PIN. |
| PG_EMAIL | | Prime Gaming email for login. Overrides EMAIL. |
| PG_PASSWORD | | Prime Gaming password for login. Overrides PASSWORD. |
| PG_OTPKEY | | Prime Gaming MFA OTP key. |

View file

@ -26,6 +26,7 @@ export const cfg = {
eg_email: process.env.EG_EMAIL || process.env.EMAIL,
eg_password: process.env.EG_PASSWORD || process.env.PASSWORD,
eg_otpkey: process.env.EG_OTPKEY,
eg_parentalpin: process.env.EG_PARENTALPIN,
// auth prime-gaming
pg_email: process.env.PG_EMAIL || process.env.EMAIL,
pg_password: process.env.PG_PASSWORD || process.env.PASSWORD,

View file

@ -156,8 +156,17 @@ try {
continue;
}
if (cfg.dryrun) continue;
iframe.locator('.payment-pin-code').waitFor().then(async () => {
if (!cfg.eg_parentalpin) {
console.error(' EG_PARENTALPIN not set. Need to enter Parental Control PIN manually.');
notify('epic-games: EG_PARENTALPIN not set. Need to enter Parental Control PIN manually.');
}
await iframe.locator('input.payment-pin-code__input').first().type(cfg.eg_parentalpin);
await iframe.locator('button:has-text("Continue")').click({ delay: 11 });
}).catch(_ => { });
if (cfg.debug) await page.pause();
if (cfg.dryrun) continue;
await page.waitForTimeout(2000);
await iframe.locator('button:has-text("Place Order")').click({ delay: 11 });