现代化自动化签到工具 - 告别 GUI,拥抱 CLI + Docker + GitHub Actions
- 🎯 纯 CLI 界面 - 无需 GUI,服务器友好
- 🐳 Docker 支持 - 一键部署,开箱即用
- ☁️ GitHub Actions - 云端运行,免费 2000 分钟/月
- 📊 数据库支持 - SQLite 存储签到历史
- 🔔 多渠道通知 - 邮件/Telegram/Webhook
- 🔧 配置灵活 - 环境变量 + YAML + .env 文件
- 📈 统计分析 - 签到成功率、趋势分析
- 🚀 易扩展 - 模块化设计,轻松添加新平台
# 1. 克隆项目
git clone https://github.com/yourusername/autosignin.git
cd autosignin
# 2. 安装依赖
pip install -r requirements.txt
# 3. 添加账号
python -m src.cli.main add netease -u "我的账号" -c "MUSIC_U=xxx; __csrf=xxx"
# 4. 执行签到
python -m src.cli.main signin --all# 1. 构建镜像
docker build -t autosignin:latest .
# 2. 运行容器
docker run -d \
--name autosignin \
-v $(pwd)/config:/app/config \
-v $(pwd)/data:/app/data \
-e NETEASE_COOKIES="MUSIC_U=xxx" \
autosignin:latest- Fork 本仓库
- 在 Settings → Secrets and variables → Actions 添加 Secrets:
NETEASE_COOKIES: 网易云音乐 CookieBILIBILI_COOKIES: B 站 Cookie
- Actions 会自动每天运行
新手必读:签到需要 Cookie 认证,请按照以下步骤获取:
-
打开网易云音乐并登录
- 访问:https://music.163.com
- 登录你的账号
-
按 F12 打开开发者工具
- 切换到 Console(控制台)标签
-
复制粘贴以下代码并按回车
console.log(document.cookie);
-
复制输出结果
- 会显示类似:
MUSIC_U=xxx; __csrf=xxx; NMTID=xxx - 完整复制整行内容
- 会显示类似:
-
添加到命令行
python -m src.cli.main add netease -u "我的账号" -c "复制的 Cookie"
详细教程:
- 📖 Cookie 获取完全指南
- 🚀 3 分钟快速上手
- 🎵 网易云音乐图文教程
其他平台:
- B 站:https://www.bilibili.com → F12 → Console → 执行相同代码
- 更多平台请参考完整指南
# 查看帮助
python -m src.cli.main --help
# 添加账号
python -m src.cli.main add netease -u "用户名" -c "Cookie 字符串"
python -m src.cli.main add bilibili -u "用户名" -c "Cookie 字符串"
# 执行签到
python -m src.cli.main signin # 签到所有账号
python -m src.cli.main signin -p netease # 签到指定平台
# 查看历史
python -m src.cli.main history # 最近 10 条
python -m src.cli.main history -l 50 # 最近 50 条
python -m src.cli.main history -p netease # 指定平台
# 查看统计
python -m src.cli.main stats # 最近 7 天
python -m src.cli.main stats -d 30 # 最近 30 天
# 列出账号
python -m src.cli.main list
python -m src.cli.main list -p netease
# 删除账号
python -m src.cli.main remove netease -u "用户名"
# 定时任务
python -m src.cli.main schedule --enable # 启用
python -m src.cli.main schedule --disable # 禁用
python -m src.cli.main schedule -t "09:00" # 设置时间
# 配置管理
python -m src.cli.main config --show # 显示配置
python -m src.cli.main config --init # 初始化配置# .env 文件示例
AUTOSIGNIN_DEBUG=false
AUTOSIGNIN_SCHEDULE=true
AUTOSIGNIN_SCHEDULE_TIME=08:00
AUTOSIGNIN_NOTIFICATION=true
# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
# 邮箱
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email@gmail.com
SMTP_PASSWORD=your_password
TO_EMAIL=receive_email@gmail.comautosignin/
├── src/
│ ├── core/ # 核心模块
│ │ ├── engine.py # 签到引擎
│ │ ├── config.py # 配置管理
│ │ ├── database.py # 数据库
│ │ └── notifier.py # 通知系统
│ ├── platforms/ # 平台签到
│ │ ├── base.py # 基础接口
│ │ ├── netease.py # 网易云音乐
│ │ └── bilibili.py # B 站
│ ├── cli/ # 命令行
│ │ └── main.py # CLI 入口
│ └── utils/ # 工具函数
│ ├── crypto.py # 加密工具
│ └── logger.py # 日志工具
├── config/ # 配置文件
│ ├── config.yaml # 主配置
│ └── accounts.yaml # 账号配置
├── data/ # 数据目录
│ └── signin.db # SQLite 数据库
├── docker/
│ └── Dockerfile # Docker 配置
├── .github/
│ └── workflows/
│ └── signin.yml # GitHub Actions
├── tests/ # 测试
├── requirements.txt
├── pyproject.toml
└── README.md
# 应用配置
app:
debug: false
# 定时任务
schedule:
enabled: true
time: "08:00"
# 通知
notification:
enabled: true
telegram:
enabled: true
bot_token: "xxx"
chat_id: "xxx"accounts:
- platform: netease
username: "我的网易云"
cookies: "MUSIC_U=xxx; __csrf=xxx"
enabled: true
- platform: bilibili
username: "我的 B 站"
cookies: "SESSDATA=xxx; bili_jct=xxx"
enabled: true| 平台 | 状态 | Cookie 要求 |
|---|---|---|
| 网易云音乐 | ✅ 已支持 | MUSIC_U, __csrf |
| 哔哩哔哩 | ✅ 已支持 | SESSDATA, bili_jct |
| CSDN | 🚧 计划中 | - |
| 淘宝 | 🚧 计划中 | - |
| 京东 | 🚧 计划中 | - |
- 联系 @BotFather 创建机器人
- 获取 Bot Token
- 获取 Chat ID(联系 @userinfobot)
- 配置到
.env或config.yaml
notification:
email:
enabled: true
smtp_server: "smtp.gmail.com"
smtp_port: 587
username: "your_email@gmail.com"
password: "your_password"
to_email: "receive_email@gmail.com"notification:
webhook:
enabled: true
url: "https://your-api.com/notify"
method: "POST"# 安装测试依赖
pip install -e ".[dev]"
# 运行测试
pytest tests/
# 代码格式化
black src/
flake8 src/欢迎提交 Issue 和 Pull Request!
# Fork 项目
git fork https://github.com/yourusername/autosignin
# 克隆到本地
git clone git@github.com:yourusername/autosignin.git
# 创建分支
git checkout -b feature/your-feature
# 提交代码
git commit -m "Add: your feature"
# 推送
git push origin feature/your-feature- 🎉 完全重构,删除 GUI
- ✨ 添加 CLI 命令行界面
- 🐳 支持 Docker 部署
- ☁️ 支持 GitHub Actions
- 📊 添加数据库支持
- 🔔 添加多渠道通知
- 🔧 优化配置系统
- 基础功能实现
- tkinter GUI 界面
- 支持 9 个平台
MIT License
感谢以下开源项目:
- Email: your.email@example.com
- Telegram: @yourchannel
- Issues: GitHub Issues
⭐ 如果这个项目对你有帮助,请给一个 Star!