Skip to content

Commit a090fa5

Browse files
committed
note generator v0.5.0
1 parent eb60026 commit a090fa5

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

material_downloader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"""
2121

2222
import json
23+
import os
2324
import re
2425
import sys
2526
import time
@@ -32,10 +33,15 @@
3233
# ── Configuration ────────────────────────────────────────────────────────────
3334

3435
CANVAS_URL = "https://canvas.nus.edu.sg"
35-
CANVAS_TOKEN = "21450~VhMGPzTKzT9wABF3VF76k8YE9LKUwfL93nU2LMc3xcfKPMhTkHJYaG3vZ34mfUke"
3636
ANTHROPIC_API_KEY = None # set below or via env
3737

3838
PROJECT_DIR = Path(__file__).parent
39+
_canvas_token_file = PROJECT_DIR / "canvas_token.txt"
40+
CANVAS_TOKEN = (
41+
_canvas_token_file.read_text().strip()
42+
if _canvas_token_file.exists() else
43+
os.environ.get("CANVAS_TOKEN", "")
44+
)
3945
SIZE_LIMIT = 1 * 1024 ** 3 # 1 GB
4046

4147
# Skip training / non-academic courses by name keywords

video_downloader.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@
2727

2828
# ── Configuration ────────────────────────────────────────────────────────────
2929
CANVAS_URL = "https://canvas.nus.edu.sg"
30-
CANVAS_TOKEN = "21450~VhMGPzTKzT9wABF3VF76k8YE9LKUwfL93nU2LMc3xcfKPMhTkHJYaG3vZ34mfUke"
3130
PANOPTO_HOST = "mediaweb.ap.panopto.com"
3231
PROJECT_DIR = Path(__file__).parent
32+
_canvas_token_file = PROJECT_DIR / "canvas_token.txt"
33+
CANVAS_TOKEN = (
34+
_canvas_token_file.read_text().strip()
35+
if _canvas_token_file.exists() else
36+
os.environ.get("CANVAS_TOKEN", "")
37+
)
3338
MANIFEST_FILE = PROJECT_DIR / "manifest.json"
3439

3540
# ── Manifest helpers ──────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)