This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Epic 免费人 (Epic Awesome Gamer) is a Python automation tool that gracefully claims weekly free games from the Epic Games Store. It uses browser automation with Playwright and includes an AI-powered hCaptcha solver using the hcaptcha-challenger library.
# Install dependencies using uv (recommended)
uv sync
# Alternative: install dev dependencies
uv sync --group dev# Format code with Black
uv run black . -C -l 100
# Lint with Ruff
uv run ruff check --fixapp/models.py: Pydantic models for Epic Games data structures (OrderItem, Order, PromotionGame)app/settings.py: Configuration management using pydantic-settings, extends hcaptcha-challenger's AgentConfigapp/services/epic_games_service.py: Main game collection logic and Epic Store interactionapp/services/epic_authorization_service.py: Authentication and login handlingapp/jobs.py: Job orchestration functions for collecting and adding games to cartapp/deploy.py: Main deployment/execution entry point
- hcaptcha-challenger[camoufox]: AI-powered captcha solving with Camoufox browser
- playwright: Browser automation framework
- pydantic-settings: Configuration management with environment variable support
- apscheduler: Task scheduling for automated runs
app/logs/: Application logs (error.log, runtime.log, serialize.log)app/runtime/: Runtime data including screenshots, recordings, and hcaptcha cacheapp/user_data/: Browser profile and session datadocker/: Docker compose configuration and environment files
Environment variables are managed through EpicSettings class in settings.py:
EPIC_EMAIL: Epic Games account email (2FA must be disabled)EPIC_PASSWORD: Epic Games account passwordGEMINI_API_KEY: Google Gemini API key for captcha solvingCRON_SCHEDULE: Cron expression for scheduled runs (default: every 5 hours)
- Initialize Epic agent with Playwright page
- Handle authentication via
EpicAuthorization - Fetch promotions from Epic Games API
- Navigate to game pages and add free games to cart
- Handle any hCaptcha challenges using AI solver
- Complete checkout process
Test execution is not allowed.