Skip to content

Releases

UM Auto-attendance v2.0 — 自动同步课表 + 签到逻辑重写

Choose a tag to compare

@CaoLongyang CaoLongyang released this 12 Nov 04:04

v2.0 — 自动同步课表 + 签到逻辑重写

从「手动填课表 + 盲点第一个链接」升级成「自动同步课表 + 按日期精确签到」。

✨ 新增

  • 自动同步课表:粘贴一次 Spectrum token,点 🔄 自动同步课表,星期 / 开始-结束时间 / 课程名 / URL 全部自动生成。
    • 只抓「对你可见」的 Attendance 活动(core_course_get_contents)
    • 用 core_group_get_course_user_groups 拿到你的分组,过滤掉别的 OCC 的活动
    • 用日历里的 session 时间(core_calendar_get_calendar_monthly_view)归并成每周时段,已经上完的时段自动剔除
    • 启动时 6 小时内自动同步一次,老师新加的活动会自己出现
  • 手动添加仍然保留,同步漏掉的课可以自己补;删掉的同步课会记住(ignored),下次不再塞回来
  • spectrum_sync.py 可以脱离界面单独运行,方便排查
  • start.bat 一键启动
  • 日志同时写入 logs/,失败原因可以追溯

🐞 修复

  • 签到选错日期:现在按行里的日期匹配「今天那一行」的 Submit attendance,不再点页面上第一个链接
  • 误报成功:不再把历史 session 的 Self-recorded 当成今天已签
  • 旧版每 10 秒新开一个 Edge,第二次就因 profile 被锁失败 → 现在整晚复用同一个窗口
  • Edge 156 的 tab crashed:4 组启动参数自动降级(兼容模式优先)
  • cannot create temp dir for unpacking extensions:给 msedgedriver 指定程序自带的 tmp/ 目录
  • 时间格式 8.00 会 int() 崩溃 → 兼容 8.00 / 8:00 / 800
  • 已登录时找不到 Log in 链接会直接失败 → 两种状态都处理
  • 签到失败改为 3 分钟重试一次、最多 10 次;已签状态写 signed.json,重启不重复签
  • GUI 适配 flet 0.82 API

⚠️ 注意

  • 这个 release 目前是源码版:需要 Python 3.10+ 和 pip install flet selenium,双击 start.bat 运行。
    Windows 的 gui.exe 一键包会另外补到 release 里。
  • 第一次使用需要:
    1. 点 🔑 Log In Spectrum 登录一次
    2. 在 https://spectrum.um.edu.my/user/managetoken.php 生成 token(Moodle mobile web service)
    3. 把 token 粘进界面,点 🔄 自动同步课表
  • config.json 结构从「纯列表」升级为 {classes, ignored, last_sync},旧文件会自动迁移,不用手动改。

📦 升级方式

git pull
python -m pip install -U flet selenium
python gui.py      # 或双击 start.bat

UM Auto-attendance v1.0

Choose a tag to compare

@CaoLongyang CaoLongyang released this 16 Mar 10:49
aec96cb

eatures

  • Fully Automated: Automatically detects and signs in to your UM Spectrum attendance sessions.
  • Background Scheduling: Runs quietly in the background with a user-friendly GUI.
  • Standalone Executable: No Python installation required—just unzip and run.
  • Password Detection: Includes an alert system for attendance sessions requiring a temporary password.

How to Use

  1. Download the UM_Auto_Attendance_v1.0.zip from the Assets section below.
  2. Extract the ZIP file to a folder on your computer.
  3. Double-click gui.exe to launch the application.
  4. For detailed setup instructions, please refer to the README.md on the main page.

Important Notes

  • Ensure your computer does not enter Sleep or Hibernate mode during class hours, as it will disconnect the bot.
  • Keep the bot_profile folder and config.json file in the same directory as the EXE.

Developer: Cao Longyang