claabs / epicgames-freegames-node

Automatically login and find available free games the Epic Games Store. Sends you a prepopulated checkout link so you can complete the checkout after logging in. Supports multiple accounts, login sessions, and scheduled runs.
https://hub.docker.com/r/charlocharlie/epicgames-freegames
MIT License
1.33k stars 89 forks source link

Captcha Page 404 cannot GET / #308

Closed amosyuen closed 1 year ago

amosyuen commented 1 year ago

Describe the bug

I get a push notification for catcha needed, but when I open the webpage I get 404 error Cannot GET /. I have configured MFA according to https://github.com/claabs/epicgames-freegames-node#two-factor-login.

Request:

http://192.168.0.249:3300/?targetId=16503728D163C23F6CF7F7F338DBE689

Response:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>
</body>
</html>

Screenshots or Logs

Trace Logs

[2022-12-30 02:48:59.697 -0800] DEBUG: Could not refresh credentials. Logging in fresh.
    user: "amosyuen@gmail.com"
[2022-12-30 02:48:59.698 -0800] TRACE: Navigating to Epic Games login page
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:09.221 -0800] TRACE: Waiting for email field
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:09.261 -0800] TRACE: Filling email field
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:09.832 -0800] TRACE: Waiting for password field
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:09.853 -0800] TRACE: Filling password field
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:10.717 -0800] TRACE: Waiting for sign-in button
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:10.744 -0800] TRACE: Clicking sign-in button
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:12.985 -0800] TRACE: Waiting for sign-in result
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:12.986 -0800] TRACE: Waiting for hcaptcha iframe
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:14.463 -0800] TRACE: Captcha detected
    user: "amosyuen@gmail.com"
[2022-12-30 02:49:14.488 -0800] INFO: Go to this URL and do something
    user: "amosyuen@gmail.com"
    url: "<redacted>"
[2022-12-30 02:49:14.490 -0800] TRACE: Sending homeassistant notification
    user: "amosyuen@gmail.com"
    reason: "LOGIN"
[2022-12-30 02:49:14.927 -0800] TRACE: Waiting for MFA possibility
    user: "amosyuen@gmail.com"

Configuration (please complete the following information):

I tested with local ip address http://192.168.0.249:3300. Note the port 3300 is bound to the internal 3000 port of the docker container. I also tested using localtunnel, but get same problem.

Additional context

I'm using this through HA addon https://github.com/alexbelgium/hassio-addons/tree/master/epicgamesfree. Version is commit https://github.com/claabs/epicgames-freegames-node/commit/1f957d3e4dfac9c053511c64636fa7459d3211a7 which is fairly new.

chit-uob commented 1 year ago

I have been getting this issue, but I fixed this problem by setting the Nginx to redirect web sockets too

# EPIC GAMES
    location ~ ^/epicgames/v1/(.*)$ {
        proxy_redirect off;
        proxy_pass http://epicgames;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;

        auth_basic           "Administrator’s Area";
        auth_basic_user_file /etc/apache2/.htpasswd;
    }

and set the WebPortalConfig in the config file like this

    "webPortalConfig": {
    "baseUrl": "https://{my_host}/epicgames/v1/",
    },

hope this helps.

amosyuen commented 1 year ago

@chit-uob Thanks a lot, that config worked for my connection through nginx.

I noticed if I try to connect directly using IP and port http://192.168.0.249:3300 that still doesn't work, I'm guessing maybe that is because of the baseUrl config?

claabs commented 1 year ago

The webserver doesn't run when it's not needed to save on resource usage. You can use testNotifiers to test the connection on setup.

amosyuen commented 1 year ago

@claabs The get failures were happening after receiving a real (non-test) notification, so I assumed the webserver was running then, or at least should have been.