@github-actions[bot] github-actions[bot] authored on 18 Feb 2024
.github ci: sync with repository template 2 years ago
scripts ci: sync with template repository 2 years ago
thu_learn_downloader feat: reorganize filename generation for attachments 2 years ago
.envrc chore: update black and other dependencies versions 2 years ago
.gitignore docs: update demo 2 years ago
.pre-commit-config.yaml ci: sync with repository template 2 years ago
CHANGELOG.md chore(main): release 0.3.0 (#93) 2 years ago
LICENSE chore: Update CI and build configurations 2 years ago
README.md chore: Update CI and build configurations 2 years ago
Taskfile.yaml ci: sync with template repository 2 years ago
cspell.json feat: reorganize filename generation for attachments 2 years ago
demo.tape chore: Update CI and build configurations 2 years ago
main.py fix: fix SSL error 2 years ago
openssl.cnf fix: fix SSL error 2 years ago
poetry.lock build(deps-dev): bump the pip group with 1 update (#104) 2 years ago
pyproject.toml build(deps-dev): bump the pip group with 2 updates (#98) 2 years ago
requirements.txt build(deps): bump the pip group with 2 updates (#101) 2 years ago
README.md

THU Web Learning Downloader

Download everything from Web Learning of Tsinghua University

GitHub Workflow Status (with event)
PyPI - Python Version
PyPI - Version

Demo

Demo

The resulting file structure looks like:

thu-learn
└── Quantum Mechanics(1)
   ├── docs
   │  └── 电子教案
   │     ├── 01-0量子力学介绍1.pdf
   │     └── 04-0量子力学介绍2.pdf
   └── work
      └── 01-第一周作业
         ├── attach-第一周作业.pdf
         ├── submit-第一周作业.pdf
         └── README.md

Usage

Usage:

$ tld [OPTIONS]

Options:

  • -u, --username TEXT
  • -p, --password TEXT
  • --prefix DIRECTORY: [default: $HOME/thu-learn]
  • -s, --semester TEXT: [default: 2023-2024-1]
  • -c, --course TEXT
  • --document / --no-document: [default: document]
  • --homework / --no-homework: [default: homework]
  • -j, --jobs INTEGER: [default: 8]
  • -l, --language [en|zh]: [default: en]
  • --log-level [NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL]: [env var: LOG_LEVEL; default: INFO]
  • --help: Show this message and exit.

Features

  • fast concurrent download
  • pretty TUI powered by rich
  • auto set mtime of downloaded files according to timestamp of remote file
  • auto skip download when local file is newer
  • dump homework details into README.md in each homework folder
  • pretty markdown files powered by prettier (require prettier installed)

Installation

  • download pre-built binary form GitHub Releases
  • pip install thu-learn-downloader
  • pipx install thu-learn-downloader