| 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, no emoji anywhere (plain text only, no symbols or emoticons).
- 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. Decide the title directly — do NOT ask the user to confirm or choose. Keep these constraints in mind:
- Fixed short title ≤12 Chinese characters — always the main title, no user confirmation
- Simple & clear — plain everyday words, core event named directly, easy to understand at a glance
- Bilibili max 80 characters — optional full version, decided directly, no confirmation
- The title should be engaging and attract clicks (e.g., use questions, surprising angles, or clear value propositions)
If the user provided a title directly, skip generation and use their title directly.
No confirmation step — proceed straight to writing files with the decided short title.
Step 3: Create Directories
mkdir -p output/video output/spider
Step 4: Create Title JSON
Write a output/spider/title.json file with the decided short 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 4 Seconds
NotebookLM-generated videos often include an ending bumper/logo frame. Trim the last 4 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 - 4" | 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 4s: ${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:
- Design a minimalist academic cover based on the video title
- Generate the cover using Python/Pillow
- Save the completed cover 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