♻️ refactor(code): remove unused code and clean up
- remove unused screenshot helper function - remove unnecessary empty arguments from launch options - add spacing for readability in async functions
This commit is contained in:
parent
58282897b5
commit
fd0fc4e981
1 changed files with 2 additions and 4 deletions
|
|
@ -19,9 +19,6 @@ const URL_CLAIM = 'https://store.epicgames.com/en-US/free-games';
|
|||
const COOKIES_PATH = path.resolve(cfg.dir.browser, 'epic-cookies.json');
|
||||
const BEARER_TOKEN_NAME = 'EPIC_BEARER_TOKEN';
|
||||
|
||||
// Screenshot Helper
|
||||
const screenshot = (...a) => path.resolve(cfg.dir.screenshots, 'epic-games', ...a);
|
||||
|
||||
// Fetch Free Games from API
|
||||
const fetchFreeGamesAPI = async () => {
|
||||
const resp = await axios.get('https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions', {
|
||||
|
|
@ -94,6 +91,7 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => {
|
|||
|
||||
console.log('🔐 Starting fresh OAuth device flow (manual approval required)...');
|
||||
let deviceResponse;
|
||||
|
||||
try {
|
||||
deviceResponse = await axios.post('https://api.epicgames.dev/epic/oauth/deviceCode', {
|
||||
client_id: '34a02cf8f4414e29b159cdd02e6184bd',
|
||||
|
|
@ -137,6 +135,7 @@ const ensureLoggedIn = async (page, context) => {
|
|||
|
||||
const attemptAutoLogin = async () => {
|
||||
if (!cfg.eg_email || !cfg.eg_password) return false;
|
||||
|
||||
try {
|
||||
await page.goto('https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=' + URL_CLAIM, {
|
||||
waitUntil: 'domcontentloaded',
|
||||
|
|
@ -318,7 +317,6 @@ export const claimEpicGamesNew = async () => {
|
|||
recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined,
|
||||
recordHar: cfg.record ? { path: `data/record/eg-${filenamify(datetime())}.har` } : undefined,
|
||||
handleSIGINT: false,
|
||||
args: [],
|
||||
});
|
||||
handleSIGINT(context);
|
||||
await stealth(context);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue