自动登录 Epic Games Store 并查找可用的免费游戏。向您发送预先填充的结帐链接,以便您可以在登录后完成结帐。支持多个帐户、登录会话和计划运行。
该工具可以使用 JSON 和环境变量的组合进行配置。配置文件支持 JSON5 语法(注释、尾随逗号等)。对于每个属性,JSON 配置值优先于相应的环境变量值。
有关每个选项、其默认值和环境变量键的详细信息,请参阅配置文档站点。
配置文件存储在挂载的/usr/app/config
卷中,可以命名为config.json
或config.json5
。
config.json
或config.json5
{
"runOnStartup" : true ,
"cronSchedule" : "0 0,6,12,18 * * *" ,
"logLevel" : "info" ,
"webPortalConfig" : {
"baseUrl" : "https://epic.example.com" ,
} ,
"accounts" : [
{
"email" : "[email protected]" ,
} ,
] ,
"notifiers" : [
// You may configure as many of any notifier as needed
// Here are some examples of each type
{
"type" : "email" ,
"smtpHost" : "smtp.gmail.com" ,
"smtpPort" : 587 ,
"emailSenderAddress" : "[email protected]" ,
"emailSenderName" : "Epic Games Captchas" ,
"emailRecipientAddress" : "[email protected]" ,
"secure" : false ,
"auth" : {
"user" : "[email protected]" ,
"pass" : "abc123" ,
} ,
} ,
{
"type" : "discord" ,
"webhookUrl" : "https://discord.com/api/webhooks/123456789123456789/A-abcdefghijklmn-abcdefghijklmnopqrst12345678-abcdefghijklmnop123456" ,
// Optional list of users or roles to mention
"mentionedUsers" : [ "914360712086843432" ] ,
"mentionedRoles" : [ "734548250895319070" ] ,
} ,
{
"type" : "telegram" ,
// Optional Custom TELEGRAM server URL
"apiUrl" : "https://api.telegram.org" ,
"token" : "644739147:AAGMPo-Jz3mKRnHRTnrPEDi7jUF1vqNOD5k" ,
"chatId" : "-987654321" ,
} ,
{
"type" : "apprise" ,
"apiUrl" : "http://192.168.1.2:8000" ,
"urls" : "mailto://user:[email protected]" ,
} ,
{
"type" : "pushover" ,
"token" : "a172fyyl9gw99p2xi16tq8hnib48p2" ,
"userKey" : "uvgidym7l5ggpwu2r8i1oy6diaapll" ,
} ,
{
"type" : "gotify" ,
"apiUrl" : "https://gotify.net" ,
"token" : "SnL-wAvmfo_QT" ,
} ,
{
"type" : "homeassistant" ,
"instance" : "https://homeassistant.example.com" ,
"token" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" ,
"notifyservice" : "mobile_app_smartphone_name" ,
} ,
{
"type" : "bark" ,
// your bark key
"key" : "xxxxxxxxxxxxxxxxxxxxxx" ,
// bark title, optional, default: 'epicgames-freegames'
"title" : "epicgames-freegames" ,
// bark group, optional, default: 'epicgames-freegames'
"group" : "epicgames-freegames" ,
// bark private service address, optional, default: 'https://api.day.app'
"apiUrl" : "https://api.day.app"
} ,
{
"type" : "ntfy" ,
"webhookUrl" : "https://ntfy.example.com/mytopic" ,
"priority" : "urgent" ,
"token" : "tk_mytoken"
} ,
{
"type" : "webhook" ,
//url of your webhook server
"url" : "https://webhook.site/my_uuid" ,
//Optional headers
"headers" : {
"Authentication" : "Bearer 123456"
}
} ,
] ,
}
该项目有时会要求您通过设备代码身份验证登录。 Epic Games 的设备代码会话将在 10 分钟后过期,因此该项目使用 Web 服务器和重定向来防止每 10 分钟向您发送一个新链接。运行 Web 服务器有两个选项:
如果您熟悉托管 Web 服务器和/或反向代理,请按照以下步骤操作:
-p 81:3000
将主机的端口 81 映射到容器的端口 3000)webPortalConfig.baseUrl
如果您无法在网络上移植正向/反向代理,您仍然可以通过设置远程访问 Web 服务器:
{
"webPortalConfig" : {
"localtunnel" : true ,
} ,
}
在你的config.json
中。
每种通知方法都有独特的设置说明。请阅读配置站点上的文档(通知方法)以获取确切的详细信息和说明。示例配置也可能有帮助。
由于可能并不总是需要用户操作,因此可以手动测试通知方法和 Web 服务器。本质上,您只需要添加:
"testNotifiers" : true ,
到config.json
的根目录。有关更多详细信息,请查看配置文档。注意:为了优化备用内存使用情况,当进程未运行时,Web 服务器不会运行。 Web 服务器仅在计划运行期间可用。
该镜像可从 GitHub Container Registry 和 Docker Hub 获取:
ghcr.io/claabs/epicgames-freegames-node:latest
charlocharlie/epicgames-freegames:latest
如果您遇到 Chromium 启动问题(登录/通知时挂起),您可以尝试 Debian 映像:
ghcr.io/claabs/epicgames-freegames-node:debian
charlocharlie/epicgames-freegames:debian
如果您使用完整的 JSON 配置,则剩下的唯一 Docker 可配置项是端口和卷。
大多数配置选项可以通过环境变量设置。在配置文档中查找每个选项键的env
标记。
如果出于某种原因您想要更改默认配置目录或配置文件名, CONFIG_DIR
和CONFIG_FILE_NAME
可以用作环境变量。
主机端口 | 集装箱港口 | 描述 |
---|---|---|
3000 | 3000 | 验证码解析页面所在Web服务器所在的端口映射 |
主办地点 | 集装箱位置 | 模式 | 描述 |
---|---|---|---|
/my/host/dir/ | /usr/app/config | rw | 配置和 cookie 文件的位置 |
建议添加-m 2g
作为docker run
参数以设置最大内存使用量为 2GB。 Chromium 进程有时可能会失控,如果没有限制,您的系统最终可能会锁定。
$ docker run -d -v /my/host/dir/:/usr/app/config:rw -p 3000:3000 -m 2g ghcr.io/claabs/epicgames-freegames-node:latest
如果没有 JSON 配置,则只能配置一个帐户。
$ docker run -d -e TZ=America/Chicago -e [email protected] -e RUN_ON_STARTUP=true -e BASE_URL=https://example.com -e SMTP_HOST=smtp.gmail.com -e SMTP_PORT=587 -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 3000:3000 -m 2g ghcr.io/claabs/epicgames-freegames-node:latest
如果您在使用设备代码身份验证登录时遇到问题,您可以导入临时会话的 cookie。
https://www.epicgames.com/id
,然后单击导出按钮: ./config
文件夹中,创建<email_address>-cookies.json
(例如[email protected]
),然后粘贴您的 cookie。如果由于某种原因您不想使用 Docker 来运行此工具,您可以通过克隆此存储库并安装 Node.js 从源代码运行它。
git clone https://github.com/claabs/epicgames-freegames-node.git
config
文件夹npm i
npm run start
git pull
npm i
在 v5 中,添加或删除了多个选项。添加/删除的选项不应影响现有的 v4 配置,但可能需要更改config.json
以获得稳定的解决方案。
cronSchedule
:默认值更改为每六个小时一次。您应该更改 cron 计划,使其运行频率超过每 8 小时一次,因为设备代码身份验证刷新令牌将在 8 小时后过期。 account.password
:不再使用登录凭据account.totp
:不再使用登录凭据noHumanErrorHelp
:购买不再自动化hcaptchaAccessibilityUrl
:在 v4 中已弃用email
:在 v4 中已弃用,请使用带有"type": "email"
notifiers
baseUrl
:在 v4 中已弃用,请使用webPortalConfig.baseUrl
onlyWeekly
:在 v4 中已弃用,请使用searchStrategy
感谢 Epigames-weekly-freegames 的灵感。
感谢 EpicResearch 提供的文档使设备代码身份验证成为可能。