文章目录
一、关于 tchMaterial-parser
1、项目概览
Python 开发的电子课本下载工具,可从国家中小学智慧教育平台获取 PDF 格式的电子课本资源。
[外链图片转存中…(img-TEFs6nxU-1750646257539)]
2、相关链接资源
- Github:https://github.com/happycola233/tchMaterial-parser
- 官方平台:https://basic.smartedu.cn/tchMaterial/
- 登录页面:https://auth.smartedu.cn/uias/login
- AUR 仓库:https://aur.archlinux.org/packages/tchmaterial-parser
- 参考项目:https://github.com/TapXWorld/ChinaTextbook
- License:MIT
3、功能特性
1、Access Token 登录支持
- 支持手动输入 Access Token
- Windows 系统自动保存至注册表
- 跨平台兼容性设计
2、批量下载功能
- 支持多 URL 同时处理
- 自动命名下载文件
- 进度可视化显示
3、用户体验优化
- 高 DPI 屏幕适配
- 图形界面操作
- 支持暂停/恢复功能
二、安装配置
1、Windows/Linux 安装
# 从 GitHub Releases 下载预编译版本
https://github.com/happycola233/tchMaterial-parser/releases
2、Arch Linux 安装
yay -S tchmaterial-parser
三、使用指南
1、获取教材链接
使用电子课本预览页面网址,格式示例:
https://basic.smartedu.cn/tchMaterial/detail?contentType=assets_document&contentId=XXXXXX
2、设置 Access Token
- 登录平台后通过 Console 开发者工具获取 Token
国家中小学智慧教育平台: https://auth.smartedu.cn/uias/login - 在控制台执行以下 JS 代码:
(function() {
const authKey = Object.keys(localStorage).find(key => key.startsWith("ND_UC_AUTH"));
const tokenData = JSON.parse(localStorage.getItem(authKey));
console.log("Access Token:", JSON.parse(tokenData.value).access_token);
})();
3、开始下载
- 粘贴教材链接
- 设置保存目录
- 点击下载按钮
四、常见问题
1、下载失败排查
- 检查 Token 有效性
- 验证网络连接
- 确认网址有效性
2、Token 存储位置
- Windows:注册表
HKEY_CURRENT_USER\Software\tchMaterial-parser
- Linux:
~/.config/tchMaterial-parser/data.json
- macOS:内存临时存储(开发中)
3、安全提示
- Token 仅本地使用
- 请勿公开分享
伊织 xAI 2025-05-18