ecnu-outliner

0.2.1 • Public • Published

ECNU-outline-downloader

Intro

本工具致力于解决下载ECNU的教学大纲繁琐的问题,仅需输入账户名,密码,百度API的密钥【用于图像识别,可选】,和要下载的课程序号即可下载所有的课程大纲与本地,现已发布至NPM 🎉

Preparation

可选项--获取百度云API的密钥

  1. 浏览器进入 百度云控制台,完成注册/登陆操作
  2. 右侧边栏找到人工智能-文字识别选项,点击进入
  3. 点击创建应用,填写完简易的表格,拿到AK【client_id】和SK【client_secret】

安装node环境

  • windows下直接进入官网下载LTS版本

  • *nix系推荐使用nvm

可选项 -- 安装yarn

yarn作为包管理工具,无缝衔接npm,而且更快

npm i -g yarn

从npm下载本工具

npm i -g ecnu-outliner
# or yarn global add ecnu-outliner

Configuration

配置文件路径在 ~/eod/config.json

使用命令行进行配置

eod init -u <username> -p <password> -A <AK> -S <SK> # 输入关键信息,获取token

使用配置文件进行配置

eod # 创建配置文件
vim ~/eod/config.json # 输入配置,token项可留空
eod refresh # 获取token

Usage

Options:
  -g, --grade <grade>        specify the grade
  -s, --semester <semester>  specify the semester
  -u, --username <username>  specify the username
  -p, --password <password>  specify the password
  -A, --AK <AK>              specify the client_id
  -S, --SK <SK>              specify the client_secret
  -o, --output <output>      specify the output dir
  -H, --hand-mode            use the handMode to input code instead of AI
  -h, --help                 output usage information

Commands:
  go <subject>               下载指定学科的大纲
  show                       检查配置
  refresh                    刷新TOKEN
  init                       初始化

Example

下载 大一上学期的计算机系的的所有大纲到当前目录的files文件夹下

eod go COMS -g 1 -s 1

下载 大二下学期的数学系的所有大纲到指定目录【绝对路径】下

eod go MATH -g 2 -s 2 -o <abspath>

手动输入验证码下载大二上学期的所有体育课的大纲 【图片文件保存在~/eod/code.jpg】

eod go CLUB -g 2 -s 1 -H

修改用户名

eod init -u <username>

TODO

  • [ ] 细化并发的粒度
  • [ ] 支持更复杂检索条件
  • [x] 加入手打验证码的选项,避免了申请百度云密钥的繁琐
  • [x] 做成二进制包,发布至NPM

Contribution

  • 求STAR
  • 欢迎向本项目提PR
  • 发现BUG请及时提出Issue

Package Sidebar

Install

npm i ecnu-outliner

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

106 kB

Total Files

31

Last publish

Collaborators

  • nihouze