Skip to main content

One-command bulk downloader for NTU COOL (Canvas) course materials — PDFs, lecture videos, and Pages.

Reason this release was yanked:

Renamed to get-class-material; please install that instead.

Project description

NTU COOL Materials

一行指令把 NTU COOL 課程的講義、Page、上課影片全部抓回本機,幫你整理好餵給 AI 複習。

ntu-cool-gcm
Found 5 course(s):

  1) 日文一下 Japanese (Ⅰ) (2)
  2) 作業管理 Operations Management
  3) 音樂、演化與大腦 Music, Evolution and the Brain
  4) 組織行為學 Organizational Behavior
  5) 管理科學模式 Management Science Model

Pick a course (1-5, or q to quit): 3

選號碼,程式自己登入 NTU COOL,把該課程所有週次的 PDFPageYouTube上課影片全部抓下來。檔名都用人看得懂的中文。


安裝(只要一行)

先確認你有 Python 3.11 以上(沒有就到 https://www.python.org/downloads/ 裝,安裝時記得勾「Add Python to PATH」),然後:

pip install ntu-cool-material

就這樣。


第一次使用

ntu-cool-gcm

第一次跑會自動幫你:

  1. 偵測缺哪些東西(Chromium 瀏覽器、yt-dlp 等)
  2. 自動下載安裝少的部分
  3. 跳出瀏覽器視窗讓你登入 NTU COOL(學號密碼)
  4. 列出你的課程讓你選
  5. 開始下載

如果還缺 Node.js 或 ffmpeg(下載 YouTube 影片用),程式會在 Windows 上嘗試用 winget 自動裝,Mac 上用 brew。如果都沒有就會顯示要你自己跑的指令。

跑完會告訴你檔案放哪:

Done. Files saved to:
  C:\Users\you\ntu-cool-gcm_material\音樂、演化與大腦 Music, Evolution and the Brain (57544)

之後再跑

ntu-cool-gcm

只要登入沒過期(一兩天內)就不用任何額外動作。已經抓過的檔案會自動跳過,只補新的。

如果登入過期了:

ntu-cool-gcm --refresh-session

YouTube cookie(不公開影片需要)

NTU 老師很多影片是 YouTube「不公開」,需要你的 Google 帳號才抓得到。第一次跑:

youtube-cookies

跳出瀏覽器,登入你平常看 NTU COOL 影片的 Google 帳號,登入完關掉就好。


你會拿到什麼

ntu-cool-gcm_material/
└── 音樂、演化與大腦 Music, Evolution and the Brain (57544)/
    ├── week1/
    │   ├── SYLBS_班次1.pdf
    │   └── 1-1 生物音樂學簡介.mp4
    ├── week2/
    │   ├── 2-1-1 伊甸園外的生命長河.pdf
    │   └── 2-3-2 緊拉慢唱的妙用.md
    └── ...
  • PDF → 老師上傳的講義
  • .md → Page 類型的內容(VS Code、Typora、Obsidian 都能讀)
  • .mp4 → 影片(YouTube + NTU 上課影片)

要換存檔位置:

ntu-cool-gcm --out D:\study

常見問題

Q:它會看到我的密碼嗎? 不會。只用瀏覽器登入後的 cookie,密碼程式從來不知道。

Q:跑到一半當機? 再跑一次就好,已經抓過的檔案不會重抓。

Q:自動安裝失敗?

ntu-cool-materials doctor --fix

doctor 會列出缺什麼,並再次嘗試自動修復。如果還是失敗,會印出該手動執行的指令給你複製貼上。

Q:只想下載某些東西?

ntu-cool-gcm --skip-pdfs          # 不要 PDF
ntu-cool-gcm --skip-pages         # 不要 Page
ntu-cool-gcm --skip-youtube       # 不要 YouTube
ntu-cool-gcm --skip-cool-videos   # 不要上課影片

可以混搭。

Q:哪些東西不會抓?

  • 鎖住的討論 / 作業 / 小考
  • 純外部連結(不是 YouTube 的那種)
  • 有 DRM 保護的 YouTube 影片(很少見)

Q:直接指定課程 ID(不要選單)?

ntu-cool-materials download-course --course-id 57544

課程 ID 就是 NTU COOL 網址裡的數字:https://cool.ntu.edu.tw/courses/57544


注意事項

  • 只用你自己的 NTU 帳號權限抓自己修的課,不繞過任何權限
  • 下載的教材依然受老師、出版社的版權保護,請勿公開散播。
  • 本工具採 MIT License — 見 LICENSE

給開發者 / 從原始碼安裝
git clone https://github.com/jabir95tsai/get_class_material.git
cd get_class_material
pip install -e .
python -m playwright install chromium
python -m unittest discover -s tests

架構說明見 CLAUDE.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ntu_cool_material-0.1.17.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ntu_cool_material-0.1.17-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file ntu_cool_material-0.1.17.tar.gz.

File metadata

  • Download URL: ntu_cool_material-0.1.17.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ntu_cool_material-0.1.17.tar.gz
Algorithm Hash digest
SHA256 53a642826f5751c691ce9ada4d0c2ea5b76357bf058ea1fdc2db579d8c1ad94c
MD5 725f2e576f9b113d329d770ade2101a3
BLAKE2b-256 316b16d04fda1fcad8cf9bb54855841c65a2563a6d7ce5ba93af3b27490a34cf

See more details on using hashes here.

File details

Details for the file ntu_cool_material-0.1.17-py3-none-any.whl.

File metadata

File hashes

Hashes for ntu_cool_material-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 f7f6903287d5287494c058178a7ab118e910560ddd2d323c77b1328ee755215c
MD5 61055c1312e80f73dea105ae91d0c7d3
BLAKE2b-256 99e68fc4442d57b504c220a2df6f2d38a2b87592d70cea8d6493ca097e948206

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page