rename repo epicgames-claimer -> free-games-claimer, cleanup, comments

This commit is contained in:
Ralf Vogler 2022-01-20 20:11:43 +01:00
parent dc6414129b
commit 38b074384d
4 changed files with 31 additions and 108 deletions

View file

@ -1,15 +1,34 @@
# epicgames-claimer
## usage
# free-games-claimer
## Usage
Setup: `npm install && npx playwright install` (downloads {chromium, firefox, webkit} (742 MB) to cache in home ([doc](https://playwright.dev/docs/browsers#managing-browser-binaries))).
Setup: `npm install && npx playwright install`
This downloads {chromium, firefox, webkit} (742 MB) to a cache in home ([doc](https://playwright.dev/docs/browsers#managing-browser-binaries)).
<!-- Use `npm run login` which opens a browser where you can login. When closing the browser, it writes a file `auth.json` containing cookies that should keep you logged in for some time (`expires` in a month?). -->
Use `npm start` to start Chrome to claim the current free games.
The first time, the script will wait for you to login. Instead of redirecting back, the website seems to just reload the login URL. Go to https://www.epicgames.com/store/en-US/free-games manually, or restart the script.
If something goes wrong, use `PWDEBUG=1 npm start` to [inspect](https://playwright.dev/docs/inspector).
So far, claiming free games has only been implemented for the two stores below.
Both start an automated Chrome instance. It will first check if you are logged in, and if not wait for you to do so. After login, you can also restart the script if it does not redirect back.
## log
If something goes wrong, use `PWDEBUG=1 node epic-games` to [inspect](https://playwright.dev/docs/inspector).
Ideally, claiming would run in *headless mode* (without browser GUI - comment out `headless: false` to test), and on a RPi:
- Epic Games Store detects running in headless mode (despite stealth plugin) and gets stuck with a captcha challenge. Did not test it yet for Prime Gaming.
- Playwright seems to not run on (headless) RPi?
### Epic Games Store
Command: `node epic-games`
Login: Instead of redirecting back, the website seems to just reload the login URL. Go to https://www.epicgames.com/store/en-US/free-games manually, or restart the script.
### Amazon Prime Gaming
Command: `node prime-gaming`
Claiming the Amazon Games works, external Epic Games also work if the account is linked.
Origin needs testing - it shows a key, which should be printed to the console, but the selector may be wrong.
Other stores not tested.
## Log
Tried [epicgames-freebies-claimer](https://github.com/Revadike/epicgames-freebies-claimer), but does not work anymore since epicgames introduced hcaptcha (see [issue](https://github.com/Revadike/epicgames-freebies-claimer/issues/172)).
@ -28,4 +47,8 @@ The listed evasions are enough to not show an hcaptcha. Script claimed game succ
Removed `main.captcha.js`.
Using Playwright Test (`main.spec.ts`) instead of Library (`main.stealth.js`) has the advantage of free CLI like `--debug` and `--timeout`.
TODO: check if stealth plugin can be setup with `contextOptions` ([doc](https://playwright.dev/docs/test-configuration#more-browser-and-context-options)).
<!-- TODO: check if stealth plugin can be setup with `contextOptions` ([doc](https://playwright.dev/docs/test-configuration#more-browser-and-context-options)). -->
Button selectors should preferably use text in order to be more stable against changes in the DOM.
Renamed repository from epicgames-claimer to free-games-claimer since a script for Amazon Prime Gaming was also added. Removed all old scripts in favor of just `epic-games.js` and `prime-gaming.js`.