vogler / free-games-claimer

Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG.
GNU Affero General Public License v3.0
2.37k stars 142 forks source link

headless mode fails at hcaptcha challenge #2

Closed vogler closed 2 years ago

vogler commented 2 years ago

Currently the script runs not in headless mode, i.e., the automated browser is visible. Comment out this line to not show the browser: https://github.com/vogler/epicgames-claimer/blob/fd3f947223733b187c5e1903be1209f8fd3b618c/main.stealth.js#L28

Running in headless mode resulted in the 20s timeout and the game not being claimed. https://github.com/vogler/epicgames-claimer/blob/fd3f947223733b187c5e1903be1209f8fd3b618c/main.stealth.js#L124 Running in headful mode afterwards successfully claimed the game.

Assumption is that the captcha is shown in headless mode, despite the stealth plugin.

vogler commented 2 years ago

Proxies to bypass Cloudflare protection also have problems with hcaptcha:

There are several browser extensions but extensions can not be used in headless mode: https://playwright.dev/docs/chrome-extensions

Free captcha solvers:

General info, detecting headless mode, anti-scraping:

vogler commented 2 years ago

Tried https://www.hcaptcha.com/accessibility, got a link via E-Mail:

This will let you set a cookie that enables you to skip requests for hCaptcha challenges.

Save this email or bookmark the link above, then open it and click the link again in order to refresh the cookie if you start to see challenges again.

Please note that the number of requests per day is limited, and your IP and account will be banned in the event of abuse.

Visited link, but after clicking 'Set Cookie' button, it just says 'Could not issue a cookie'.

vogler commented 2 years ago

Assumption is that the captcha is shown in headless mode, despite the stealth plugin.

Confirmed by saving screenshots on failure: 3766754a5fbed1c22fcd3145b47e7d6f8d2ad9ed.

vogler commented 2 years ago

Fixed by #11 (run non-headless in docker).

vogler commented 1 year ago

Tried https://www.hcaptcha.com/accessibility, got a link via E-Mail:

Visited link, but after clicking 'Set Cookie' button, it just says 'Could not issue a cookie'.

Maybe that was because I didn't read the Browser Instructions for Cross-Site Cookies:

Go to Privacy and Security, then Cookies and other site data. Make sure "Block third-party cookies" is not enabled.

Edit: no, the setting already was 'Block third-party cookies in Incognito'. However, now it seems to work. Requested a new link and got 'Cookie set'.