两个 AI 驱动的学习工具:
视频 URL → LaTeX PDF 讲义 | 论文 → 自包含 HTML 解读
.tex 源文件 + 配图 + 编译好的 PDF. ├── README.md ├── LICENSE ├── scripts/ │ ├── clean_subs.py # YouTube 自动字幕去重 │ ├── prepare_cover.sh # 封面格式转换(webp/png → jpg) │ ├── verify_figures.py # 图文三方验证(时间戳 × 字幕 × 画面) │ └── smart_crop.py # 课件区域检测(实验性,默认不启用) └── skills/ └── lecture-to-notes/ ├── SKILL.md # Skill 主定义(适用于 Codex / Claude Code) ├── agents/ │ └── openai.yaml # Agent UI 元数据 └── assets/ └── notes-template.tex # LaTeX 模板
mkdir -p ~/.codex/skills
cp -R skills/lecture-to-notes ~/.codex/skills/
cp scripts/smart_crop.py ~/.codex/skills/lecture-to-notes/
# 复制 skill
cp skills/lecture-to-notes/SKILL.md ~/.claude/commands/lecture-to-notes.md
# 复制资产
mkdir -p ~/.claude/assets/lecture-to-notes
cp skills/lecture-to-notes/assets/notes-template.tex ~/.claude/assets/lecture-to-notes/
cp scripts/smart_crop.py ~/.claude/assets/lecture-to-notes/
然后在 Claude Code 中使用 /lecture-to-notes <URL> 触发。
# macOS
brew install yt-dlp ffmpeg imagemagick poppler
# LaTeX(需要 CTeX 中文支持)
# 如果尚未安装:brew install --cask mactex
pip install Pillow # smart_crop.py 必需
pip install openai-whisper # Bilibili / 无字幕视频必需
| 工具 | 必需 | 用途 |
|---|---|---|
yt-dlp | ✓ | 视频/字幕/元数据下载 |
ffmpeg | ✓ | 帧提取、音频提取 |
xelatex | ✓ | LaTeX 编译 |
magick | ✓ | Contact sheet、帧处理 |
python3 + Pillow | ✓ | 智能裁剪 |
whisper | △ | 语音转写(无 CC 字幕时) |
视频 URL │ ├─ yt-dlp ──→ 元数据 + 封面 + 字幕(CC) + 视频 │ │ │ 字幕不可用?──→ Whisper 转写 │ ├─ ffmpeg ──→ 按章节密集帧采样 (1帧/15秒) │ ├─ smart_crop.py ──→ 自动裁剪课件区域,去除讲师 │ ├─ magick montage ──→ Contact sheet 人工/AI审查 │ ├─ 筛选高价值帧 ──→ figures/ 目录 │ ├─ 基于模板生成 .tex ──→ 结构化中文讲义 │ └─ xelatex ×2 ──→ 最终 PDF(含目录)
| 特性 | llm-note-generator | wdkns-skills | lecture-to-notes |
|---|---|---|---|
| 全自动(无需手动粘贴 prompt) | ✗ | ✓ | ✓ |
| Bilibili 支持 | ✗ | ✗ | ✓ |
| 智能课件裁剪 | ✗ | ✗ | ✓ |
| 字幕回退(Whisper) | ✗ | ✗ | ✓ |
| 分P视频处理 | ✗ | ✗ | ✓ |
| Contact sheet 帧审查 | ✗ | ✓ | ✓ |
| 时间溯源脚注 | ✗ | ✓ | ✓ |
| 高信息密度 box 系统 | ✓ | ✓ | ✓ |
本项目受以下开源工作启发:
GPL-3.0 — 与上游项目保持一致。