Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 本地测试配置 — 不会被提交(见 .gitignore)
# 复制为 .env 后填入自己的值:cp .env.example .env

# 一个或多个 JWT,多账号用逗号或分号分隔
DUOLINGO_JWT=

# 时区,需与 Duolingo 账号设置一致
TZ=Asia/Shanghai

# 请求间隔毫秒
DELAY_MS=1500

# 每个步骤的最大重试次数
MAX_RETRY=3
41 changes: 41 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Duolingo Daily

on:
schedule:
# UTC 01:00 = 北京时间 09:00
- cron: "0 1 * * *"
# UTC 13:00 = 北京时间 21:00,作为当日补跑
- cron: "0 13 * * *"
workflow_dispatch:

concurrency:
group: duolingo-daily
cancel-in-progress: false

permissions:
contents: read

jobs:
daily:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
TZ: ${{ vars.TZ || 'Asia/Shanghai' }}
DELAY_MS: ${{ vars.DELAY_MS || '1500' }}
MAX_RETRY: ${{ vars.MAX_RETRY || '3' }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: src/requirements.txt

- name: Install dependencies
run: pip install -r src/requirements.txt

- name: Run daily quests & keep streak
env:
DUOLINGO_JWT: ${{ secrets.DUOLINGO_JWT }}
run: python src/daily.py
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 本地配置与凭据
.env
.env.local
!.env.example

# 运行时生成的账号与配置
accounts.json
config.json
src/accounts.json
src/config.json

# Launcher 缓存(内含 accounts.json 等凭据)
.DuoHacker-Python_cache/
.pylingo_cache/

# Python
__pycache__/
*.py[cod]
.venv/
venv/
Loading