notebooklm-research
VerifiedAutomate source-grounded research with Google NotebookLM. Create notebooks from URLs, text, or local files; ask cited questions; run fast or deep web research; create articles and social drafts; and generate or download audio, video, cinematic video, slides, reports, study guides, quizzes, flashcards, mind maps, infographics, and data tables. Use when a user asks for NotebookLM, cited source analysis, research-to-content workflows, podcasts, slides, study material, artifact generation, RSS digests, or trend research.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.3 KB |
| examples/research-to-article/README.md | markdown | 1.9 KB |
| examples/research-to-threads/README.md | markdown | 1.4 KB |
| examples/trend-to-content/README.md | markdown | 2.0 KB |
| references/api_surface.md | markdown | 6.4 KB |
| references/output_formats.md | markdown | 3.2 KB |
| references/pipeline_recipes.md | markdown | 3.5 KB |
| scripts/__init__.py | script | 0 B |
| scripts/auth_helper.pyexecutable | script | 6.0 KB |
| scripts/common.py | script | 26.5 KB |
| scripts/make_video.shexecutable | script | 3.7 KB |
| scripts/notebooklm_client.pyexecutable | script | 20.2 KB |
| scripts/pipeline.pyexecutable | script | 26.1 KB |
| scripts/skill_installer.pyexecutable | script | 4.5 KB |
scripts/make_video.sh
View on GitHub#!/bin/bash
# make_video.sh — 將 NotebookLM 投影片 + Podcast 合成 YouTube 影片
#
# 用法:
# ./scripts/make_video.sh slides.pdf podcast.m4a output.mp4
#
# 需求:
# - ffmpeg (brew install ffmpeg)
# - pdftoppm (brew install poppler)
set -euo pipefail
if [ $# -lt 3 ] || [ $# -gt 4 ]; then
echo "用法: $0 <slides.pdf> <podcast.m4a> <output.mp4> [--force]"
echo ""
echo "範例:"
echo " $0 output/slides.pdf output/podcast-zh.m4a output/youtube-zh.mp4"
exit 1
fi
PDF="$1"
AUDIO="$2"
OUTPUT="$3"
FORCE=false
if [ $# -eq 4 ]; then
if [ "$4" != "--force" ]; then
echo "錯誤: 第四個參數只能是 --force" >&2
exit 2
fi
FORCE=true
fi
if [ ! -f "$PDF" ]; then
echo "錯誤: 找不到投影片 PDF: $PDF" >&2
exit 1
fi
if [ ! -f "$AUDIO" ]; then
echo "錯誤: 找不到音檔: $AUDIO" >&2
exit 1
fi
if [ -L "$OUTPUT" ]; then
echo "錯誤: 拒絕寫入符號連結: $OUTPUT" >&2
exit 1
fi
if [ -d "$OUTPUT" ]; then
echo "錯誤: 輸出路徑是目錄: $OUTPUT" >&2
exit 1
fi
if [ -e "$OUTPUT" ] && [ "$FORCE" != true ]; then
echo "錯誤: 輸出檔已存在: $OUTPUT(使用 --force 才會覆寫)" >&2
exit 1
fi
# 檢查依賴
command -v ffmpeg >/dev/null 2>&1 || { echo "錯誤: 需要 ffmpeg (brew install ffmpeg)"; exit 1; }
command -v pdftoppm >/dev/null 2>&1 || { echo "錯誤: 需要 pdftoppm (brew install poppler)"; exit 1; }
command -v ffprobe >/dev/null 2>&1 || { echo "錯誤: 需要 ffprobe (隨 ffmpeg 一起安裝)"; exit 1; }
# 建立可精確清理的暫存目錄
VIDEO_WORK_DIR=$(mktemp -d "${TMPDIR:-/tmp}/notebooklm-video.XXXXXX")
cleanup() {
rm -rf -- "$VIDEO_WORK_DIR"
}
trap cleanup EXIT
VIDEO_DPI=${VIDEO_DPI:-200}
if ! [[ "$VIDEO_DPI" =~ ^[0-9]+$ ]] || [ "$VIDEO_DPI" -lt 72 ] || [ "$VIDEO_DPI" -gt 600 ]; then
echo "錯誤: VIDEO_DPI 必須是 72 到 600 的整數" >&2
exit 2
fi
echo "[1/4] 轉換 PDF 為 PNG..."
pdftoppm -png -r "$VIDEO_DPI" "$PDF" "$VIDEO_WORK_DIR/slide"
# 計算頁數和每頁時長
shopt -s nullglob
SLIDES=("$VIDEO_WORK_DIR"/slide-*.png)
SLIDE_COUNT=${#SLIDES[@]}
if [ "$SLIDE_COUNT" -eq 0 ]; then
echo "錯誤: PDF 轉換失敗,沒有產生任何 PNG"
exit 1
fi
echo "[2/4] 取得音檔長度..."
AUDIO_DURATION=$(ffprobe -v quiet -show_entries format=duration -of csv=p=0 "$AUDIO")
if ! [[ "$AUDIO_DURATION" =~ ^[0-9]+([.][0-9]+)?$ ]] || [ "$AUDIO_DURATION" = "0" ]; then
echo "錯誤: 無法取得有效音檔長度" >&2
exit 1
fi
PER_SLIDE=$(awk -v duration="$AUDIO_DURATION" -v count="$SLIDE_COUNT" 'BEGIN { printf "%.6f", duration / count }')
echo " 音檔: ${AUDIO_DURATION}s, ${SLIDE_COUNT} 頁, 每頁 ${PER_SLIDE}s"
echo "[3/4] 合成影片..."
# 建構 ffmpeg 輸入參數
FILTERS=""
CONCAT_INPUTS=""
IDX=0
FFMPEG_ARGS=()
for PNG in "${SLIDES[@]}"; do
FFMPEG_ARGS+=(-loop 1 -t "$PER_SLIDE" -framerate 1 -i "$PNG")
FILTERS="$FILTERS [${IDX}:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:color=F5F3EE,setsar=1,format=yuv420p[v${IDX}];"
CONCAT_INPUTS="${CONCAT_INPUTS}[v${IDX}]"
IDX=$((IDX + 1))
done
FILTER_COMPLEX="${FILTERS}${CONCAT_INPUTS}concat=n=${SLIDE_COUNT}:v=1:a=0[outv]"
mkdir -p "$(dirname "$OUTPUT")"
if [ "$FORCE" = true ]; then
OVERWRITE_FLAG=-y
else
OVERWRITE_FLAG=-n
fi
ffmpeg "$OVERWRITE_FLAG" "${FFMPEG_ARGS[@]}" \
-i "$AUDIO" \
-filter_complex "$FILTER_COMPLEX" \
-map "[outv]" -map "${IDX}:a" \
-c:v libx264 -preset fast -crf 28 \
-c:a aac -b:a 192k \
-movflags +faststart \
"$OUTPUT" 2>&1 | tail -3
echo "[4/4] 完成!"
echo ""
ls -lh "$OUTPUT"
DURATION=$(ffprobe -v quiet -show_entries format=duration -of csv=p=0 "$OUTPUT")
MINUTES=$(awk -v duration="$DURATION" 'BEGIN { printf "%.1f", duration / 60 }')
echo " 長度: ${MINUTES} 分鐘"
echo " 可直接上傳 YouTube"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |