NTU COOL Get Class Material
一行指令,把 NTU COOL 的整門課搬回你的電腦
Download NTU COOL course files, announcements, pages, and videos into organized local folders.
📄 講義附件 · 📢 公告 · 📝 課程頁面 · 🎬 上課影片 · 🤖 NotebookLM 匯入(選用)
目錄
快速開始
事前準備:先安裝 Python 3.11 以上。Windows 安裝時若有 Add Python to PATH 選項,請勾選,裝完再開新的 PowerShell。macOS 可使用 python.org 的安裝程式。
Windows(PowerShell)
python -m pip install get-class-material
get-class-material
macOS(終端機)
python3 -m pip install get-class-material
get-class-material
下載結果
預設存到「文件(Documents)」下的 ntu-cool-gcm_material。每門課會建立「課程名稱(課程 ID)」資料夾,單元名稱有週次時會依週次整理。
ntu-cool-gcm_material/
└── 課程名稱 (57544)/
├── course_overview.md ← 課程索引,從這裡開始
├── announcements/
│ └── announcements.md
├── week1/
│ ├── 講義.pdf
│ ├── 課程頁面.md
│ ├── 上課錄影.mp4
│ └── attachments/
└── week2/ …
| 內容 | 存檔方式 |
|---|---|
| 講義與附件 | 保留原始檔案格式 |
| 課程頁面與公告 | 頁面存成 Markdown,公告集中在 announcements/announcements.md |
| YouTube 與 NTU COOL 上課錄影 | 下載成功的影片存為 .mp4 |
| 課程索引 | 從 course_overview.md 查看單元和檔案位置 |
提示:可隨時重跑。補抓教材或下載中斷時,重新執行
get-class-material並選同一門課。程式會重用已完成的檔案,並在伺服器支援時續傳中斷的檔案。
啟用 NotebookLM 匯入時,超過 200 MB 的 MP4 會用 ffmpeg 和 ffprobe 自動分成 part 1、part 2 等可獨立播放的檔案。每段最多 200 MB,各占一個 NotebookLM 來源名額,原始影片會保留。
匯入時預設只顯示略過的檔案總數。加上 --show-skipped 可查看每種原因和對應的檔案,也能搭配 --dry-run 預覽。
常用指令
| 要做什麼 | 指令 |
|---|---|
| 只下載附件、頁面與公告 | get-class-material --skip-youtube --skip-cool-videos |
| 指定下載位置 | get-class-material --out "我的課程" |
依課程 ID 下載(網址中 courses/ 後的數字) |
ntu-cool-materials download-course --course-id 57544 |
| 重新登入 NTU COOL | get-class-material --refresh-session |
| 檢查環境 | ntu-cool-materials doctor |
| 查看選項與版本 | get-class-material --help、get-class-material --version |
| 更新工具 | Windows 用 python -m pip install --upgrade get-class-material,macOS 用 python3 -m pip install --upgrade get-class-material |
其他指令與相容性
- 跳過附件、頁面或公告可分別加上
--skip-pdfs、--skip-pages、--skip-announcements。 - 加上
--lang en使用英文介面,或加上--keep-terminal在結束時保留終端機。 - 舊指令
ntu-cool-gcm仍可使用。 - 列出可見課程可執行
ntu-cool-materials courses --refresh-session。單獨下載並顯示公告可執行ntu-cool-materials announcements --course-id 57544 --refresh-session --print。
疑難排解
| 遇到的狀況 | 處理方式 |
|---|---|
找不到 python 或版本太舊 |
安裝 Python 3.11 以上並重開終端機。macOS 用 python3 --version 確認。 |
已安裝套件,但找不到 get-class-material |
Windows 可用 python -m ntu_cool_materials pick 啟動,macOS 請改用 python3。 |
| NTU COOL 登入已過期 | 執行 get-class-material --refresh-session,在瀏覽器完成登入。 |
| 缺少 Chromium、FFmpeg 或 Node.js | 執行 ntu-cool-materials doctor --fix。若指令找不到,可改用 python -m ntu_cool_materials doctor --fix(macOS 用 python3)。 |
| Windows 出現 WinError 4551 | 若啟動器被封鎖,可試 python -X utf8 -m ntu_cool_materials pick。若被封鎖的是 Chromium,可安裝 Google Chrome 作為登入備援。 |
Windows 找不到 winget |
從 Microsoft Store 安裝 App Installer,或手動安裝 FFmpeg 和 Node.js。裝完請重開 PowerShell。 |
macOS 出現 CERTIFICATE_VERIFY_FAILED |
若使用 python.org 的 Python,在「應用程式 → Python 3.x」執行 Install Certificates.command。 |
YouTube 影片下載失敗
公開與不公開(unlisted)影片會先嘗試直接下載。若工具詢問是否使用已登入的瀏覽器帳號重試,請先確認該帳號能播放影片。
- Chrome/Edge:輸入
y前,先完全結束瀏覽器與背景程序,讓工具能讀取登入 cookie。 - Safari:可在「系統設定 → 隱私權與安全性 → 完整磁碟取用權限」授權使用的終端機。
- 缺少影音工具:先跑
doctor --fix。macOS 若已安裝 Homebrew,也可執行brew install ffmpeg node。 - 受 DRM 保護的影片無法透過本工具下載。
給開發者(原始碼安裝與測試)
git clone https://github.com/jabir95tsai/get_class_material.git
cd get_class_material
python -m pip install -e .
python -m playwright install chromium
python -m unittest discover -s tests
macOS 請用 python3。開發筆記見 CLAUDE.md。
授權、隱私與使用規範
注意:下載的教材僅限個人學習使用,請勿公開散布。 詳細條款如下。
- 軟體開源授權(MIT License)
- 本專案原始碼依 MIT License 授權釋出(Copyright (c) 2026 jabir)。
- 任何人均得免費使用、複製、修改、合併、發布或散佈本軟體,惟須於軟體複本中保留原著作權聲明與授權條文;本軟體依「現況(AS IS)」提供,不附帶任何明示或默示擔保,開發者不對使用本工具所生之任何直接或間接損害負擔保或賠償責任。
- 第三方套件與外部元件授權
- 本工具相依或使用之第三方軟體包括
requests、playwright、yt-dlp(選用功能另含notebooklm-py、markitdown),以及使用者端安裝之 Chromium、FFmpeg 與 Node.js;各元件均依其原專案授權條款規範。
- 本工具相依或使用之第三方軟體包括
- 課程教材著作權與使用範圍
- 本工具僅以使用者本人登入之合法權限存取課程資料,不繞過任何身分驗證、權限控管或 DRM 保護。
- 下載所得之講義、投影片、頁面文字與影音內容,其著作權仍歸原授課教師、學校或原權利人所有。僅限修課學生個人學習與複習使用,禁止公開轉載、上傳網路、商業利用或散布予未經授權之第三方。
- 若啟用選用之 NotebookLM 匯入功能(透過非官方個人版介面運作),請確認僅上傳你有權傳輸至第三方服務之教材,並自行遵守學校規定與 Google 服務條款。
- 帳號安全與本機憑證隱私
- 台大帳號密碼僅由使用者親自輸入於工具開啟之 NTU COOL 官方登入頁,本程式不讀取、不側錄、不儲存亦不回傳密碼。
- 登入後之工作階段憑證與 cookie 僅存於本機
~/.ntu-cool-gcm/.secrets/(若目前目錄已有.secrets/則沿用),不會傳送至開發者或任何第三方伺服器。該資料夾等同於你的登入狀態,切勿上傳至 GitHub、雲端硬碟或分享給他人。
Metadata
Release files for get-class-material 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| get_class_material-1.0.5.tar.gz | 140.0 kB | With provenance | Details for get_class_material-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| get_class_material-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for get_class_material-1.0.5-py3-none-any.whl |
Total release size: 251.8 kB
Release files / get_class_material-1.0.5.tar.gz
| Download URL | get_class_material-1.0.5.tar.gz |
|---|---|
| Size | 140.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1a2040e270f60d350846c0d0f653a296451b0ecfcbdaedcdd8dd0254ad926af
|
|
BLAKE2b-256 checksum How to use checksums |
133f0918ffce9b908f4d45d09607710b67447de1ef676bde43d6dd11e5272c58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / get_class_material-1.0.5-py3-none-any.whl
| Download URL | get_class_material-1.0.5-py3-none-any.whl |
|---|---|
| Size | 111.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8646c8ec8b130f02486773b1d0883f5b225a974de5227fed179788b13370674
|
|
BLAKE2b-256 checksum How to use checksums |
5bfba3064fb5df0d58bf494c4969b3b7c2f246d9d3e71fea6c443aee8f4a10f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for get-class-material 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for get_class_material-1.0.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.