| name | sjtu-canvas-downloader |
| description | Use this skill when an agent needs to list, inspect, or download SJTU Canvas classroom videos from this repository through the supported CLI backend. |
SJTU Canvas Downloader
Use the machine-facing CLI in src/cli.py. Do not automate the human
interactive entrypoint main.py.
Run commands from the repository root.
Preconditions
- The Canvas API key must be configured as
CANVAS_API_KEY="..." in .env.
- Do not ask the user to paste the API key into chat.
- Do not print credentials,
session_url, business tokens, full download URLs,
or videos/download.txt contents.
- Download commands contact
oc.sjtu.edu.cn and v.sjtu.edu.cn; actual video
downloads require aria2c.
Commands
List available courses:
uv run python -m src.cli list-courses --json
List lectures for one course:
uv run python -m src.cli list-lectures --course-id COURSE_ID --json
Download selected lectures:
uv run python -m src.cli download \
--course-id COURSE_ID \
--lectures LECTURES \
--channel both \
--subtitle-lang res \
--json
Prepare subtitles and videos/download.txt without starting aria2:
uv run python -m src.cli download \
--course-id COURSE_ID \
--lectures LECTURES \
--channel screen \
--subtitle-lang res \
--no-aria2 \
--json
Workflow
- Run
list-courses --json.
- Match the user's requested course by name. If ambiguous, summarize the
candidate names and ask the user to choose.
- Run
list-lectures --course-id ... --json.
- Match the requested lectures by
ref, title, or date. If ambiguous, ask.
- Run
download only after the selection is clear.
Prefer JSON output for agent use. Summarize results instead of pasting large
raw JSON blocks.
Lecture Selection
The --lectures value supports:
all
- single refs:
S001
- comma lists:
S001,S003
- ranges:
S003-S005
- numeric shorthand:
1,3-5
Use ref values from list-lectures. Do not ask the user to type platform
internal lecture ids.
Download Options
--channel choices:
--subtitle-lang defaults to res. Use none to skip subtitles. Other values
are passed through as platform transcript fields.
By default, download starts aria2 after creating subtitle files and
videos/download.txt. Use --no-aria2 when the user only wants the aria2 input
file prepared or when you need to avoid a long-running video download.
Outputs are written under videos/. The CLI report includes counts and the
aria2 input path; it intentionally does not expose tokens or download URLs.