| name | notebooklm-prep-upload |
| description | Prepare a downloaded NotebookLM video for upload: create the title JSON file and move the video to the correct path expected by the Bilibili/Douyin upload e2e scripts. |
NotebookLM Prepare Upload
After downloading a NotebookLM video, prepare it for the upload pipeline by creating the metadata JSON and placing the video file in the expected location.
Context
The upload e2e scripts expect this structure under the project root:
output/
video/
video.mp4 ← video file
cover.jpg ← cover (optional)
spider/
title.json ← {"title": "..."}
Workflow Steps
Step 1: Gather Input
Ask the user for:
- Source video path — where the downloaded video is located
- Video topic or title (optional) — if the user doesn't provide one, infer the topic from the filename automatically
- Description (optional) — will be set as
VIDEO_DESC env var. Constraints: first line must be a headline title, at most 3 topics, each line ≤ 200 characters total.
- Tags (optional, comma-separated, max 3) — will be set as
VIDEO_TAGS env var. Most platforms (e.g. Bilibili) limit tags to 3. Pick the most relevant ones.
Step 2: Generate Engaging Title
If the user didn't provide a title, infer the topic from the filename. Then generate an attractive, clickable title suitable for Bilibili/Douyin. Keep these constraints in mind:
- Douyin max 30 characters (the upload script auto-truncates to 30)
- Bilibili max 80 characters
- The title should be engaging and attract clicks (e.g., use questions, surprising angles, or clear value propositions)
Create two versions of the title:
- A short version (≤30 chars) for Douyin
- A full version (≤80 chars) for Bilibili
If the user provided a title directly, skip generation and use their title directly.
Present both title versions to the user and let them confirm or request adjustments before proceeding.
Step 3: Create Directories
mkdir -p output/video output/spider
Step 4: Create Title JSON
Write a output/spider/title.json file with the user-confirmed title:
{
"title": "<generated-title>"
}
Use the Bilibili version (≤80 chars) as the main title.
Step 5: Move Video
Copy the source video to output/video/video.mp4:
cp "<source-path>" "output/video/video.mp4"
Step 6: Trim Last 3 Seconds
NotebookLM-generated videos often include an ending bumper/logo frame. Trim the last 3 seconds from the video before upload using ffmpeg:
DURATION=$(ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 "output/video/video.mp4")
TRIM_TO=$(echo "$DURATION - 3" | bc)
ffmpeg -i "output/video/video.mp4" -t "$TRIM_TO" -c copy \
"output/video/video-trimmed.mp4"
mv "output/video/video-trimmed.mp4" "output/video/video.mp4"
echo "Trimmed last 3s: ${DURATION}s → ${TRIM_TO}s"
Requires ffmpeg and ffprobe. Install via brew install ffmpeg (macOS) or apt install ffmpeg (Linux).
Step 7: Generate Minimalist Academic Cover
Use the minimalist-academic-cover skill to generate a cover via NotebookLM infographic generation instead of extracting a video frame.
The cover skill will:
- Pass the design spec directly as a prompt to
notebooklm generate infographic --style editorial
- Generate an infographic artifact
- Download the completed infographic to
input/cover.png
This replaces the old ffmpeg frame-extraction with a professional minimalist academic design.
Design rules (see full spec in the cover skill):
- Solid color background (deep navy #1a1a2e)
- Large bold centered title (sans-serif, dead center)
- Light subtitle at ¼–⅕ title size below
- No logos, dates, author names, or decoration
Step 8: Report
Tell the user:
- ✅
output/video/video.mp4 is ready
- ✅
output/spider/title.json is ready
- ✅ Remind them they can also set
VIDEO_DESC and VIDEO_TAGS before running pnpm upload:all
- ✅ Ready to run:
pnpm upload:all