From 95413f7ab0a57fe9f4afb8c656404b3007b4cb7e Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 28 Dec 2021 17:15:35 +0100 Subject: [PATCH] Update README.md --- README.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8cc8ab8..7c39589 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,22 @@ # epicgames-claimer +## usage -Tried https://github.com/Revadike/epicgames-freebies-claimer, but it does not work anymore since epicgames introduced hcaptcha: -https://github.com/Revadike/epicgames-freebies-claimer/issues/172 +Run `npm 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. + +Then use `npm start` to run Chrome in headless mode to claim the current free game. + +## 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)). 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 iframe. -Works up to button 'I Agree', then it shows an hcaptcha. +Playwright Inspector and `codegen` to generate scripts are nice, but failed to generate the right code for clicking a button in an iframe. -- https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra - - https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth - - https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-recaptcha - - `playwright-extra@next`: https://github.com/berstend/puppeteer-extra/pull/303#issuecomment-775277480 +Added [main.spec.ts](https://github.com/vogler/epicgames-claimer/commit/e5ce7916ab6329cfc7134677c4d89c2b3fa3ba97#diff-d18d03e9c407a20e05fbf03cbd6f9299857740544fb6b50d6a70b9c6fbc35831) 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](https://github.com/vogler/epicgames-claimer/commit/e5ce7916ab6329cfc7134677c4d89c2b3fa3ba97#diff-d18d03e9c407a20e05fbf03cbd6f9299857740544fb6b50d6a70b9c6fbc35831) which uses beta of `playwright-extra@next` and `@extra/recaptcha@next` (from [comment on puppeteer-extra](https://github.com/berstend/puppeteer-extra/pull/303#issuecomment-775277480)). +However, `playwright-extra` seems to be old and missing `:has-text` selector (fixed [here](https://github.com/vogler/epicgames-claimer/commit/ba97a0e840b65f4476cca18e28d8461b0c703420)) and `page.frameLocator`, so the script did not run without adjustments. +Also, solving via [2captcha](https://2captcha.com?from=13225256) is a paid service which takes time and may be unreliable. + +Added [main.stealth.js](https://github.com/vogler/epicgames-claimer/commit/64d0ba8ce71baec3947d1b64acd567befcb39340#diff-f70d3bd29df4a343f11062a97063953173491ce30fe34f69a0fc52517adbf342) which uses the stealth plugin without `playwright-extra` wrapper but up-to-date `playwright` (from [comment](https://github.com/berstend/puppeteer-extra/issues/454#issuecomment-917437212)). +The listed evasions are enough to not show an hcaptcha. Script claimed game successfully in headful mode.