USST TronClass rollcall watcher and notifier
Project description
usst-rollcall
上海理工大学一网畅学课程签到提醒和自动签到工具。
它可以在后台定时检查是否有课程签到,并在发现签到时发送通知。你也可以按需开启自动签到。
功能
- 检查课程签到
- 有签到时推送通知
- 自动登录
- 支持 Bark、Gotify、邮件、控制台通知
- 支持多个账号
- 支持数字签到自动提交
- 支持雷达签到自动提交,但需要自己配置坐标
- 默认只在
07:30-20:30检查,减少无意义请求
二维码签到暂不支持自动提交。
安装
推荐使用 uv 安装,适合长期运行命令行工具:
uv tool install usst-rollcall
更新:
uv tool upgrade usst-rollcall
也可以使用 pip 安装:
pip install usst-rollcall
安装后检查命令是否可用:
usst-rollcall --help
usst-rollcall version
第一次使用
1. 生成配置文件
usst-rollcall init-config
查看配置文件位置:
usst-rollcall where
常见位置:
| 系统 | 配置文件 |
|---|---|
| Windows | %LOCALAPPDATA%\usst-rollcall\config.yaml |
| Linux / VPS | ~/.config/usst-rollcall/config.yaml |
2. 填入账号密码
在配置文件中填写账号密码登录信息:
login:
enabled: true
login_url: https://1906.usst.edu.cn/login?next=/user/index
form_id: casLoginForm
username: 你的学号或账号
password: 你的密码
可以先主动测试一次登录:
usst-rollcall login
usst-rollcall login-status
程序会自动维护内部 session 缓存,你不需要手动处理。
3. 测试能否查询签到
usst-rollcall poll-once
如果能正常输出课程签到数量,说明配置基本可用。
配置通知
打开配置文件,找到 notify。
Bark 示例
notify:
bark:
enabled: true
server: https://api.day.app
key: 你的 Bark key
测试通知:
usst-rollcall notify-test
如果手机能收到消息,通知配置成功。
自动登录说明
如果 watch 或 poll-once 遇到 401,工具会自动尝试重新登录,再继续请求。
如果本地还没有 session 缓存,程序也会先自动登录,再开始查询。
开启自动监控
推荐监控所有已启用账号:
usst-rollcall watch --all
只监控默认账号:
usst-rollcall watch
默认情况下,程序只会在 07:30-20:30 之间请求签到接口。其他时间程序会保持运行,但不会检查签到。
启动后会先显示运行摘要,你可以看到当前是否启用了 --all、是否启用了 --sign、正在监控哪些账号。
如果部署在 VPS,建议用 supervisor、systemd、Docker 或其他进程管理工具守护运行。
开启自动签到
自动签到默认关闭。需要你手动打开配置文件,把 sign.enabled 改为 true:
sign:
enabled: true
number_enabled: true
radar_enabled: false
notify_result: true
临时开启一次:
usst-rollcall poll-once --sign
监控时开启:
usst-rollcall watch --all --sign
说明:
- 数字签到:默认支持。
- 雷达签到:需要你自己配置经纬度,并开启
radar_enabled。 - 二维码签到:暂不支持。
雷达签到配置示例:
sign:
enabled: true
radar_enabled: true
radar_location:
latitude: 31.000000
longitude: 121.000000
accuracy: 35.0
多账号
编辑配置文件里的 accounts:
accounts:
- id: main
name: 我的账号
enabled: true
session_file: sessions/main.json
login:
enabled: true
username: "2023000001"
password: "你的密码1"
- id: friend
name: 朋友账号
enabled: true
session_file: sessions/friend.json
login:
enabled: true
username: "2023000002"
password: "你的密码2"
运行所有账号:
usst-rollcall watch --all
每个账号可以单独配置通知和自动签到。
每个账号都可以配置自己的登录方式、通知方式和自动签到策略。
常用命令
| 命令 | 作用 |
|---|---|
usst-rollcall where |
查看配置文件位置 |
usst-rollcall version |
查看当前安装版本 |
usst-rollcall --version |
查看当前安装版本 |
usst-rollcall accounts |
查看账号列表 |
usst-rollcall login |
使用配置中的账号密码重新登录并刷新 session |
usst-rollcall login-status |
查看当前账号是否已配置自动登录、是否已有缓存 session |
usst-rollcall poll-once |
立即检查一次签到 |
usst-rollcall poll-once --notify |
检查一次,有新签到就通知 |
usst-rollcall watch --all |
持续监控所有启用账号 |
usst-rollcall watch --all --sign |
持续监控所有启用账号,并临时开启自动签到 |
usst-rollcall watch |
只持续监控默认账号 |
usst-rollcall notify-test |
测试通知 |
更新
如果使用 uv tool 安装:
uv tool upgrade usst-rollcall
如果使用 pip 安装:
pip install -U usst-rollcall
联系方式
有问题或建议可以联系:
a.oxidizing172@aleeas.com
常见问题
supervisor 里找不到 usst-rollcall
这是因为 supervisor 的 PATH 和你登录 shell 的 PATH 不一样。
解决方法:在 supervisor 启动命令里写完整路径,例如:
/root/.local/bin/usst-rollcall watch --all --sign
提示 401 或查询失败
通常是缓存 session 过期了,或者账号密码登录配置不完整。
先执行:
usst-rollcall login
usst-rollcall login-status
如果还是失败,再检查配置文件里的 login.enabled、username 和 password。
没收到通知
先运行:
usst-rollcall notify-test
如果测试通知也收不到,优先检查 Bark key、Gotify token 或邮箱配置。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file usst_rollcall-0.1.3.tar.gz.
File metadata
- Download URL: usst_rollcall-0.1.3.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe4ad77b46cc6c91ae22fb5153bd1f54ab6b1f4a0a9624596dd6eddbca00887e
|
|
| MD5 |
94549a31c5baddd7c1216be461926133
|
|
| BLAKE2b-256 |
8e88153b8d6b08dc87065bae90581443911d4827ad53cef03e034d227728ff76
|
Provenance
The following attestation bundles were made for usst_rollcall-0.1.3.tar.gz:
Publisher:
release.yml on Nitmi/usst-rollcall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
usst_rollcall-0.1.3.tar.gz -
Subject digest:
fe4ad77b46cc6c91ae22fb5153bd1f54ab6b1f4a0a9624596dd6eddbca00887e - Sigstore transparency entry: 1394295873
- Sigstore integration time:
-
Permalink:
Nitmi/usst-rollcall@4bed5abfcfaf248ea6798a42c7a11ff52f25e1e2 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/Nitmi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4bed5abfcfaf248ea6798a42c7a11ff52f25e1e2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file usst_rollcall-0.1.3-py3-none-any.whl.
File metadata
- Download URL: usst_rollcall-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e0801a1189f6d5e1d552e072f6b0dda4f9e0f33bab9a0f19051a093de2aa264
|
|
| MD5 |
ac788d805ddf382e44a7912c1ef17573
|
|
| BLAKE2b-256 |
0115ad86bc86bd593e1be8d734f0a83c8eb2a5fe3a80990572275206860f5394
|
Provenance
The following attestation bundles were made for usst_rollcall-0.1.3-py3-none-any.whl:
Publisher:
release.yml on Nitmi/usst-rollcall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
usst_rollcall-0.1.3-py3-none-any.whl -
Subject digest:
1e0801a1189f6d5e1d552e072f6b0dda4f9e0f33bab9a0f19051a093de2aa264 - Sigstore transparency entry: 1394295875
- Sigstore integration time:
-
Permalink:
Nitmi/usst-rollcall@4bed5abfcfaf248ea6798a42c7a11ff52f25e1e2 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/Nitmi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4bed5abfcfaf248ea6798a42c7a11ff52f25e1e2 -
Trigger Event:
push
-
Statement type: