No description
Find a file
2022-01-13 20:04:13 +01:00
.gitignore use launchPersistentContext instead of storageState, works in headful now, support multiple games 2021-12-31 02:49:26 +01:00
main.spec.ts npm login -> npm run login 2021-12-28 20:59:53 +01:00
main.stealth.js claimer for Amazon Prime Gaming (no ext stores) 2022-01-13 20:04:13 +01:00
old.stealth.js use launchPersistentContext instead of storageState, works in headful now, support multiple games 2021-12-31 02:49:26 +01:00
package-lock.json rm main.captcha.js 2021-12-28 17:25:01 +01:00
package.json annotate context type, defaultTimeout 30s -> 10s 2021-12-28 18:26:27 +01:00
prime-gaming.js claimer for Amazon Prime Gaming (no ext stores) 2022-01-13 20:04:13 +01:00
README.md comment anti-captcha.com as alternative to 2captcha.com 2022-01-10 12:00:39 +01:00
util.js claimer for Amazon Prime Gaming (no ext stores) 2022-01-13 20:04:13 +01:00

epicgames-claimer

usage

Setup: npm install && npx playwright install (downloads {chromium, firefox, webkit} (742 MB) to cache in home (doc)).

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.

log

Tried epicgames-freebies-claimer, but does not work anymore since epicgames introduced hcaptcha (see issue).

Played around with puppeteer before, now trying newer https://playwright.dev which is pretty similar. Playwright Inspector and codegen to generate scripts are nice, but failed to generate the right code for clicking a button in an iframe.

Added main.spec.ts which was the test script generated by npx playwright codegen with manual fix for clicking buttons in the created iframe. Can be executed by npx playwright test. The test runner has options --debug and --timeout and can execute typescript which is nice. However, this only worked up to the button 'I Agree', and then showed an hcaptcha.

Added main.captcha.js which uses beta of playwright-extra@next and @extra/recaptcha@next (from comment on puppeteer-extra). However, playwright-extra seems to be old and missing :has-text selector (fixed here) and page.frameLocator, so the script did not run without adjustments. Also, solving via 2captcha is a paid service which takes time and may be unreliable.

Added main.stealth.js which uses the stealth plugin without playwright-extra wrapper but up-to-date playwright (from comment). The listed evasions are enough to not show an hcaptcha. Script claimed game successfully in headful mode.

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).