eg: EG_COUNTRY to set country of account to avoid unavailable-in-region
This commit is contained in:
parent
254b674c65
commit
47be85f45c
3 changed files with 3 additions and 1 deletions
|
|
@ -77,6 +77,7 @@ Available options/variables and their default values:
|
||||||
| EG_PASSWORD | | Epic Games password for login. Overrides PASSWORD. |
|
| EG_PASSWORD | | Epic Games password for login. Overrides PASSWORD. |
|
||||||
| EG_OTPKEY | | Epic Games MFA OTP key. |
|
| EG_OTPKEY | | Epic Games MFA OTP key. |
|
||||||
| EG_PARENTALPIN | | Epic Games Parental Controls PIN. |
|
| EG_PARENTALPIN | | Epic Games Parental Controls PIN. |
|
||||||
|
| EG_COUNTRY | US | Epic Games [country of account](https://www.epicgames.com/account/personal). Set to avoid unavailable-in-region. |
|
||||||
| PG_EMAIL | | Prime Gaming email for login. Overrides EMAIL. |
|
| PG_EMAIL | | Prime Gaming email for login. Overrides EMAIL. |
|
||||||
| PG_PASSWORD | | Prime Gaming password for login. Overrides PASSWORD. |
|
| PG_PASSWORD | | Prime Gaming password for login. Overrides PASSWORD. |
|
||||||
| PG_OTPKEY | | Prime Gaming MFA OTP key. |
|
| PG_OTPKEY | | Prime Gaming MFA OTP key. |
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ export const cfg = {
|
||||||
eg_password: process.env.EG_PASSWORD || process.env.PASSWORD,
|
eg_password: process.env.EG_PASSWORD || process.env.PASSWORD,
|
||||||
eg_otpkey: process.env.EG_OTPKEY,
|
eg_otpkey: process.env.EG_OTPKEY,
|
||||||
eg_parentalpin: process.env.EG_PARENTALPIN,
|
eg_parentalpin: process.env.EG_PARENTALPIN,
|
||||||
|
eg_country: process.env.EG_COUNTRY || 'US', // This should fit your account's country since sometimes there are replacements for games that are unavailable-in-region. See country/region under https://www.epicgames.com/account/personal and use its two-letter country code.
|
||||||
// auth prime-gaming
|
// auth prime-gaming
|
||||||
pg_email: process.env.PG_EMAIL || process.env.EMAIL,
|
pg_email: process.env.PG_EMAIL || process.env.EMAIL,
|
||||||
pg_password: process.env.PG_PASSWORD || process.env.PASSWORD,
|
pg_password: process.env.PG_PASSWORD || process.env.PASSWORD,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ handleSIGINT();
|
||||||
|
|
||||||
// get current promotionalOffers from json instead of checking the website
|
// get current promotionalOffers from json instead of checking the website
|
||||||
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // otherwise got UNABLE_TO_GET_ISSUER_CERT_LOCALLY
|
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // otherwise got UNABLE_TO_GET_ISSUER_CERT_LOCALLY
|
||||||
const promoJson = await (await fetch('https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions')).json(); // ?locale=en-US
|
const promoJson = await (await fetch(`https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?country=${cfg.eg_country}`)).json(); // ?locale=en-US
|
||||||
const currentGames = promoJson.data.Catalog.searchStore.elements.filter(e => e.promotions?.promotionalOffers?.length);
|
const currentGames = promoJson.data.Catalog.searchStore.elements.filter(e => e.promotions?.promotionalOffers?.length);
|
||||||
const gameURL = e => `https://store.epicgames.com/p/${e.catalogNs.mappings[0].pageSlug}`; // gameURL(e.urlSlug) is wrong and leads to 404!
|
const gameURL = e => `https://store.epicgames.com/p/${e.catalogNs.mappings[0].pageSlug}`; // gameURL(e.urlSlug) is wrong and leads to 404!
|
||||||
console.log('Free games:', currentGames.map(e => `${e.title} - ${gameURL(e)}`));
|
console.log('Free games:', currentGames.map(e => `${e.title} - ${gameURL(e)}`));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue