Ricardo-Osorio / epicgames-weekly-freegames

Automatically grab the weekly free games made available on epicgames store
MIT License
76 stars 7 forks source link

Automatically get the epicgames store weekly free games

I like free games but I don't like repeating the same process over and over again when it can be automated... And that's why I made this!

Important to read first

This was an introductory project to web scrapping for me and not only the script would stop working with any updates to the site html but since this project started EPIC implemented a mandatory 2FA to redeem the free weekly games... because of that I no longer maintain this proejct. Any pull requests are welcome but I recommend you check out @charlocharlie's approach to this problem using their API instead! https://github.com/charlocharlie/epicgames-freegames-node

What it is

This is a simple python3.7 script making use of selenium webdriver and chrome driver to run run chrome in headless mode, navigate to the epicgames store, login into your account and redeem all weekly free games available. All of this inside of a docker container.

Getting started

Personally I avoid hosting such processes on my machine so I don't have to worry about having it turned ON during the times when it's supposed to run. So I opt for deploying it to AWS FARGATE and completely forget it exists... until I check my account on the website that is! ;)

Locally (Docker)

To run it locally, pull the image from docker-hub:

docker pull ricosorio/epicgames-weekly-freegames:latest

And run a docker container from the newly downloaded image:

docker run -e EMAIL=<EMAIL> -e PASSWORD=<PASSWORD> ricosorio/epicgames-weekly-freegames

Replacing the environment variables EMAIL and PASSWORD for your epicgames store credentials.

AWS Cloud (Fargate)

To run the image AWS Fargate (ECS) start by creating a task definition that that pulls the image from ricosorio/epicgames-weekly-freegames:latest. Note that you don't need to specify the host (by default it pulls from docker-hub).

When it comes to how much resources the container needs, I find it enough to have 0.5GB and lowest version of CPU - 0.25.

Optional configuration

Different options can be provided to alter the output or execution of the program. All available options are:

Running a docker container with these:

docker run -e TIMEOUT=15 -e LOGIN_TIMEOUT=20 -e LOGLEVEL=DEBUG -e SLEEPTIME=43200 -e EMAIL=<EMAIL> -e PASSWORD=<PASSWORD> ricosorio/epicgames-weekly-freegames

Docker Compose

version: '2'

services:

    egs-freegame:
        build:
            context: ./epicgames-weekly-freegames/
            dockerfile: Dockerfile
        restart: always
        environment:
            - TIMEOUT=10
            - LOGIN_TIMEOUT=15
            - SLEEPTIME=43200
            - LOGLEVEL=DEBUG
            - EMAIL=example@example.com
            - PASSWORD=password123

Login with Cookies

If the program closes because it encounters in a captcha you can try to login through cookies. To do this you must: