- src/device-login.js: New module implementing Epic Games OAuth Device Flow - src/logger.js: Simple logger module for consistent logging - src/config.js: Add deviceAuthClientId and deviceAuthSecret config - epic-claimer-new.js: Use OAuth Device Flow instead of browser login - Cloudflare bypass: Device Flow uses API, user logs in own browser - Based on: https://github.com/claabs/epicgames-freegames-node How it works: 1. Get client credentials from Epic OAuth API 2. Get device authorization code with verification URL 3. Send user notification with login link 4. User clicks link and logs in (handles Cloudflare manually) 5. Poll for authorization completion 6. Save and use access/refresh tokens 7. Tokens auto-refresh on expiry Benefits: - No Cloudflare issues (no bot detection) - Persistent tokens (no repeated logins) - Works in headless mode - More reliable than browser automation |
||
|---|---|---|
| .gitea/workflows | ||
| .vscode | ||
| src | ||
| test | ||
| .dockerignore | ||
| .eslintrc.cjs | ||
| .gitignore | ||
| aliexpress.js | ||
| CONTRIBUTING.md | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| epic-claimer-new.js | ||
| epic-games.js | ||
| eslint.config.js | ||
| gog.js | ||
| jsconfig.json | ||
| keep-alive.sh | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| prime-gaming.js | ||
| README.md | ||
| sonar-project.properties | ||
| steam-games.js | ||
| unrealengine.js | ||
Free Games Claimer (Fork)
- Optional notifications:
pip install appriseAutomates 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 installdownloads 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.jsonpersistiert; 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,PASSWORDglobal; per storeEG_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(defaultdata/screenshots) - Notifications:
NOTIFY='...'(Apprise URL), optionalNOTIFY_TITLE - Browser profile:
BROWSER_DIR(defaultdata/browser) - Recording:
RECORD=1to save videos/HAR todata/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),HEADLESSis derived fromSHOW/DEBUG - Directories:
SCREENSHOTS_DIR,BROWSER_DIR,DATA_DIR(prefix for data; default underdata/) - 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) forkeep-alive.sh - Repo banner:
REPO_URLfor 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=1for 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=1→data/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).
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 |