No description
Find a file
root 5d41b323e5
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s
feat: Final hybrid login implementation (FlareSolverr + Cookie persistence)
- epic-claimer-new.js: Complete rewrite with practical approach
  - FlareSolverr integration for Cloudflare solving
  - Cookie persistence (saved to epic-cookies.json)
  - Auto-load cookies on startup (no login needed if valid)
  - Manual login fallback via noVNC if needed
  - Proper 2FA/OTP support
  - Better error handling and logging

- SETUP.md: Complete setup guide
  - Docker Compose examples
  - Environment variable reference
  - Troubleshooting section
  - 2FA setup instructions
  - Volume backup/restore

- README.md: Add reference to SETUP.md

- OAUTH_DEVICE_FLOW_ISSUE.md: Document why OAuth Device Flow doesn't work
  - Epic Games doesn't provide public device auth credentials
  - Client credentials flow requires registered app
  - Hybrid approach is the practical solution

How it works:
1. First run: Login via browser (FlareSolverr helps with Cloudflare)
2. Cookies saved to epic-cookies.json
3. Subsequent runs: Load cookies, no login needed
4. If cookies expire: Auto-fallback to login flow
5. Manual login via noVNC if automation fails

This is the approach used by all successful Epic Games claimer projects.
2026-03-08 14:52:13 +00:00
.gitea/workflows fix: use separate locators with OR for captcha detection 2026-03-07 14:37:00 +00:00
.vscode test 2026-01-08 16:02:10 +00:00
src feat: Add OAuth Device Flow login to bypass Cloudflare 2026-03-08 14:26:44 +00:00
test Clean up Sonar issues and lint warnings 2025-12-30 16:45:17 +00:00
.dockerignore sort .dockerignore 2023-11-07 12:03:15 +01:00
.eslintrc.cjs chore(config): update ESLint environment to support browser globals 2026-03-07 12:49:45 +00:00
.gitignore ♻️ refactor(auth): streamline login process 2026-01-08 12:42:33 +00:00
aliexpress.js refactor: migrate ESLint configuration to flat config and remove redundant rule files 2026-03-06 15:38:58 +00:00
CONTRIBUTING.md Allow forks to create builds and fix failing build 2023-10-27 11:37:32 +00:00
docker-compose.yml refactor(config): add network configuration and dependencies for inter-service communication 2026-03-08 13:22:01 +00:00
docker-entrypoint.sh docs: Add Cloudflare troubleshooting section to README 2026-03-08 14:06:49 +00:00
Dockerfile fix: run container as root to keep browser profile writable 2025-12-31 11:47:36 +00:00
epic-claimer-new.js feat: Final hybrid login implementation (FlareSolverr + Cookie persistence) 2026-03-08 14:52:13 +00:00
epic-games.js fix: Multiple bug fixes and code cleanup 2026-03-08 13:58:57 +00:00
eslint.config.js refactor: migrate ESLint configuration to flat config and remove redundant rule files 2026-03-06 15:38:58 +00:00
gog.js chore: make version banner configurable and speed up login waits 2025-12-31 11:58:35 +00:00
jsconfig.json fix vscode problem in jsconfig with module vs. moduleResolution 2023-11-07 16:45:17 +01:00
keep-alive.sh chore: add keep-alive helper script 2025-12-31 12:08:20 +00:00
LICENSE Create LICENSE - AGPL-3.0 2023-11-06 19:12:16 +01:00
OAUTH_DEVICE_FLOW_ISSUE.md feat: Final hybrid login implementation (FlareSolverr + Cookie persistence) 2026-03-08 14:52:13 +00:00
package-lock.json fix: Multiple bug fixes and code cleanup 2026-03-08 13:58:57 +00:00
package.json fix: Multiple bug fixes and code cleanup 2026-03-08 13:58:57 +00:00
prime-gaming.js chore: make version banner configurable and speed up login waits 2025-12-31 11:58:35 +00:00
README.md feat: Final hybrid login implementation (FlareSolverr + Cookie persistence) 2026-03-08 14:52:13 +00:00
SETUP.md feat: Final hybrid login implementation (FlareSolverr + Cookie persistence) 2026-03-08 14:52:13 +00:00
sonar-project.properties ci: exclude coverage and cpd for sonar 2025-12-31 10:40:44 +00:00
steam-games.js Further clean Sonar: merge base RUN, strip comments, node imports 2025-12-30 15:47:28 +00:00
unrealengine.js fix: resolve remaining sonar findings 2025-12-31 10:38:07 +00:00

Free Games Claimer (Fork)

Quality Gate Status

  • Optional notifications: pip install apprise Automates claiming of free games for:
  • Amazon Luna Gaming / Luna claims (including external stores like GOG, Epic Games, Legacy Games )
  • GOG giveaways
  • Optional extras: Steam stats, AliExpress dailies (not implemated yet) -p 6080:6080
    Requirements

  • Docker or Podman (recommended), or Node.js ≥ 20 for local runs
  • Optional notifications: pip install apprise
  • Playwright dependencies are baked into the container; locally, npm install downloads Firefox.

Quickstart (Docker Run)

docker run --rm -it \
  -p 6080:6080 \
  -v fgc-data:/fgc/data \
  -v fgc-browser:/home/fgc/.cache/browser \
  -v fgc-playwright:/home/fgc/.cache/ms-playwright \
  -e SHOW=1 \
  git.sky-net.it/nocci/free-games-claimer:dev \
  bash -c "node prime-gaming; node gog; ./keep-alive.sh"
  • Ports 6080/5900: noVNC/VNC (only needed with SHOW=1)
  • Volumes persist profile + Playwright-Browser, damit Logins/Downloads bleiben.

Docker Compose Example (persistent volumes)

services:
  free-games-claimer:
    image: git.sky-net.it/nocci/free-games-claimer:dev
    container_name: fgc
    environment:
      - SHOW=1                  # show browser via VNC/noVNC
      # - PG_EMAIL=...
      # - PG_PASSWORD=...
      # - PG_OTPKEY=...
      - BROWSER_DIR=/fgc/data/browser
      - LOGIN_VISIBLE_TIMEOUT=20  # optional: faster login detection
      - KEEP_ALIVE_SECONDS=86400  # optional: keep container alive after runs
    volumes:
      - fgc-data:/fgc/data
      - fgc-browser:/home/fgc/.cache/browser
      - fgc-playwright:/home/fgc/.cache/ms-playwright
    ports:
      - "6080:6080"             # noVNC
      # - "5900:5900"           # VNC optional
    command: bash -c "node prime-gaming; node gog; ./keep-alive.sh"
volumes:
  fgc-data:
  fgc-browser:
  fgc-playwright:

Hinweis: Das Image läuft auf dev; bei Bedarf :latest wählen.

Configuration (Environment Variables)

Common options:

  • SHOW=0/1 (0 = headless, 1 = UI)
  • WIDTH, HEIGHT (browser size)
  • TIMEOUT, LOGIN_TIMEOUT (seconds)
  • Epic: EG_MODE=legacy|new (legacy Playwright flow or neuer API-getriebener Claimer), EG_PARENTALPIN, EG_EMAIL, EG_PASSWORD, EG_OTPKEY
  • Epic (new mode): Cookies werden unter data/browser/epic-cookies.json persistiert; OAuth Device Code Flow benötigt ggf. einmalige Freigabe im Browser.
    • Falls Device-Code-Endpunkt nicht erreichbar ist (404/Bad Request), fällt der neue Modus automatisch auf manuellen Browser-Login zurück.
  • Login: EMAIL, PASSWORD global; per store EG_EMAIL, EG_PASSWORD, EG_OTPKEY, PG_EMAIL, PG_PASSWORD, PG_OTPKEY, GOG_EMAIL, GOG_PASSWORD
  • Prime Gaming: PG_REDEEM=1 (auto-redeem keys, experimental), PG_CLAIMDLC=1, PG_TIMELEFT=<days> to skip long-remaining offers
  • Screenshots: SCREENSHOTS_DIR (default data/screenshots)
  • Notifications: NOTIFY='...' (Apprise URL), optional NOTIFY_TITLE
  • Browser profile: BROWSER_DIR (default data/browser)
  • Recording: RECORD=1 to save videos/HAR to data/record/
  • Debugging: DEBUG=1 (opens Playwright inspector), DEBUG_NETWORK=1 (logs requests), TIME=1 (prints timings)
  • Dry run / Interaction: DRYRUN=1 (do not claim), INTERACTIVE=1 (ask before claiming), HEADLESS is derived from SHOW/DEBUG
  • Directories: SCREENSHOTS_DIR, BROWSER_DIR, DATA_DIR (prefix for data; default under data/)
  • VNC/noVNC: VNC_PASSWORD (for Docker entrypoint), NOVNC_PORT/VNC_PORT (Docker)
  • General timeouts: TIMEOUT (per action), LOGIN_TIMEOUT (extra time for login)
  • Login detection: LOGIN_VISIBLE_TIMEOUT (ms) to abort sooner when login buttons not present
  • Keep-alive: KEEP_ALIVE_SECONDS (default 86400) for keep-alive.sh
  • Repo banner: REPO_URL for log output

You can place a data/config.env; it is loaded via dotenv and is overridden by explicitly set environment variables.

Local Run Without Docker

npm install
SHOW=0 PG_EMAIL=... PG_PASSWORD=... PG_OTPKEY=... node prime-gaming.js
  • Playwright downloads Firefox to ~/.cache/ms-playwright.
  • Use SHOW=1 for a visible browser (requires GUI/Xvfb).

Persistence & Outputs

  • Data/status: data/*.json (per store)
  • Browser profile: data/browser
  • Screenshots: data/screenshots/<store>/
  • Optional videos/HAR: RECORD=1data/record/

Tip: For captchas or first-time login, run with SHOW=1 and log in once; cookies stay in the profile. Notifications via NOTIFY help surface errors (e.g., captcha, login).


📖 Complete Setup Guide

For detailed setup instructions, see SETUP.md.


Troubleshooting

Cloudflare / "Incorrect response" Error (Epic Games)

If you see "Incorrect response. Please refresh the page." or repeated "word word" text on the login page, Cloudflare is blocking the automated browser.

Solution 1: Use Docker Compose (recommended)

The included docker-compose.yml has FlareSolverr pre-configured:

docker compose up

Solution 2: Manual login with persistent cookies

docker run --rm -it \
  -p 6080:6080 \
  -v fgc-data:/fgc/data \
  -v fgc-browser:/home/fgc/.cache/browser \
  -e SHOW=1 \
  -e EG_MODE=new \
  git.sky-net.it/nocci/free-games-claimer:dev \
  node epic-games

Then open http://localhost:6080, log in manually. Cookies are saved for subsequent runs.

Solution 3: Disable strict Firefox privacy settings

The entrypoint now creates a user.js with Cloudflare-friendly settings. If you still have issues, delete the browser profile to regenerate it:

docker volume rm fgc-browser

Common Issues

Error Cause Fix
"Incorrect response" Cloudflare bot detection Use FlareSolverr or manual login
Captcha loop IP flagged Wait, change IP, or use FlareSolverr
"Not signed in" timeout Login expired Run with SHOW=1 and re-login
Repeated "word" text Cloudflare fingerprinting See Cloudflare solutions above