Skip to content

Commit

Permalink
Merge pull request #44 from claabs/hcaptcha
Browse files Browse the repository at this point in the history
Add support for hCaptcha emails. Fixes login.
  • Loading branch information
claabs authored Dec 21, 2020
2 parents 9eae9f2 + 08c8fd6 commit 45ca54f
Show file tree
Hide file tree
Showing 28 changed files with 3,071 additions and 270 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
!src
!package*.json
!tsconfig.json
!entrypoint.sh
!entrypoint.sh

src/site/public/node_modules
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
"eslint.enable": true,
"typescript.tsdk": "node_modules\\typescript\\lib",
"docker.defaultRegistryPath": "charlocharlie",
"eslint.workingDirectories": [
".",
"./src/site/public"
]
}
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ FROM base as build

# Copy all source files
COPY package*.json tsconfig.json ./
COPY src/site/public/package*.json src/site/public/tsconfig.json ./src/site/public/

# Add dev deps
RUN npm ci
RUN npm ci && cd src/site/public && npm ci

# Copy source code
COPY src src
Expand All @@ -39,8 +40,9 @@ ENV NODE_ENV production

# Copy package.json for version number
COPY package*.json ./
COPY src/site/public/package*.json src/site/public/tsconfig.json ./src/site/public/

RUN npm ci --only=production
RUN npm ci --only=production && cd src/site/public && npm ci --only=production

# Steal compiled code from build image
COPY --from=build /usr/app/dist ./dist
Expand Down
46 changes: 22 additions & 24 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ I decided to take a different approach by only using the APIs that the Epic Game

## Scope

* ~~Login~~
* CSRF/XSRF
* Login
* Captcha
* Emails you when a link to solve a Captcha when required
* 2FA handing via TOTP token
Expand All @@ -37,28 +36,6 @@ I decided to take a different approach by only using the APIs that the Epic Game

## Setup

### Cookie Import

In December 2020, Epic Games introduced [hcaptcha](https://www.hcaptcha.com/) as their new login captcha provider.
This broke the automatic login procedure, however you can manually load your browser's cookie data and let the container remember your login.

1. Setup the container per the below instructions
1. In your web browser, log in to the Epic Games Store with "Remember me" checked.
1. Install the [Cookie Editor](https://cookie-editor.cgagnier.ca/) or [EditThisCookie](http://www.editthiscookie.com/) browser extension.
1. While viewing the Epic Games Store page, copy your cookies to clipboard by clicking the "Export" button on the extension:
![Cookie Editor export button](https://github.com/claabs/epicgames-freegames-node/blob/master/img/cookie-editor.png?raw=true)
1. In your mounted `./config` folder, create `<email_address>-cookies.json` (e.g. `[email protected]`), and paste in your cookies.
1. Start the epicgames-freegames-node container and the cookies will automatically be converted to a new format.

**Notes:**

* If you log out of the browser session you copied the cookies from, the container will break
* If you have the container scheduled regularly, it should automatically refresh the cookies and keep you logged in for some time.
* If you get an email prompting you to solve a captcha to log in, you should repeat the above process.
* Epic Games still uses Arkose for purchase captchas, so you still may recieve emails when games are redeemed.
* Your password is optional when using this, so you can fill it with some junk if you prefer. It just can't be `""`.
* Try not to schedule the container for exactly every 8 hours. Some of the cookies expire exactly then which just breaks the login-less refresh.

### Captcha Emails

Recent events have removed the ability to easily automate Captcha solving with Google Speech-to-text. This is a workaround that makes **you** solve a captcha by emailing you a link where you can solve it.
Expand Down Expand Up @@ -180,6 +157,27 @@ If you have two-factor authentication (2FA) enabled on your account, you need to

`$ docker run -d -e TZ=America/Chicago -e [email protected] -e PASSWORD=abc123 -e TOTP=ABC123 -e RUN_ON_STARTUP=true -e BASE_URL=https://example.com -e SMTP_HOST=smtp.gmail.com -e SMTP_PORT=587 -e SMTP_HOST=smtp.gmail.com -e [email protected] -e EMAIL_SENDER_NAME="Epic Games Captchas" -e [email protected] -e SMTP_SECURE=true -e [email protected] -e SMTP_PASSWORD=abc123 -v /my/host/dir/:/usr/app/config:rw -p 3001:3000 charlocharlie/epicgames-freegames:latest`

### Cookie Import

If you're experiencing issues logging with with username and password, you can import cookies for a temporary session.

1. Setup the container per the below instructions
1. In your web browser, log in to the Epic Games Store with "Remember me" checked.
1. Install the [Cookie Editor](https://cookie-editor.cgagnier.ca/) or [EditThisCookie](http://www.editthiscookie.com/) browser extension.
1. While viewing the Epic Games Store page, copy your cookies to clipboard by clicking the "Export" button on the extension:
![Cookie Editor export button](https://github.com/claabs/epicgames-freegames-node/blob/master/img/cookie-editor.png?raw=true)
1. In your mounted `./config` folder, create `<email_address>-cookies.json` (e.g. `[email protected]`), and paste in your cookies.
1. Start the epicgames-freegames-node container and the cookies will automatically be converted to a new format.

**Notes:**

* Due to device ID issues, you will only stay logged in for 8 hours.
* If you log out of the browser session you copied the cookies from, the container will break.
* If you have the container scheduled regularly, it should automatically refresh the cookies and keep you logged in for some time.
* If you get an email prompting you to solve a captcha to log in, you should repeat the above process.
* Epic Games still uses Arkose for purchase captchas, so you still may recieve emails when games are redeemed.
* Your password is optional when using this, so you can fill it with some junk if you prefer. It just can't be `""`.

## Development

### Recommended Dev Environment Variables
Expand Down
Loading

0 comments on commit 45ca54f

Please sign in to comment.