NotebookLM Audio Generator Skill
This skill automates the process of using Google's NotebookLM to generate a deep-dive audio overview from various sources and download it to a specified directory.
Prerequisites
This skill relies on the notebooklm-mcp-cli package and the epub2txt utility for .epub support. Before proceeding, ensure the user has them installed and authenticated.
Installation & Setup
If the user has not set up the CLI or the conversion tool, instruct them to do so first:
- 1. Install the NotebookLM CLI:
uv tool install notebooklm-mcp-cli
# OR
pip install notebooklm-mcp-cli
- 2. Authenticate:
nlm login
- 3. Install epub2txt (for .epub support):
The skill expects
epub2txt to be installed in your programs directory. Clone and initialize it using the following commands:
CODEBLOCK2
Workflow
When activated, follow these steps strictly in order. Do not skip steps.
Step 1: Gather Information
Ask the user for the following information one by one to prepare for the generation:
- 1. Ask for a desired name for the new notebook. If not provided, use the default name "Audio Overview Notebook".
- Source Selection: Ask the user to select their sources from the following options:
-
Local Files: .pdf,
.txt, and
.epub (which will be automatically converted). Use GUI pickers:
-
macOS: osascript -e "set theFiles to choose file with prompt \"Select your source file(s):\" multiple selections allowed true" ...
-
Linux: zenity --file-selection --multiple ...
-
Windows: PowerShell
OpenFileDialog.
-
Web/Video URLs: Ask the user to provide any website or YouTube URLs.
-
Google Drive: Ask for Google Drive Document IDs.
- 3. Preferred Language: Ask the user for the preferred output language (BCP-47 code).
-
Options: Provide common choices:
en (English - default),
zh (Chinese),
ja (Japanese),
es (Spanish),
fr (French),
de (German).
- 4. Download Destination: Use a GUI directory picker to select where the audio file should be saved.
Crucial: Ask the user interactively to confirm they have provided/selected all the sources they wish to include before proceeding.
Step 2: Create a New Notebook
Use the notebook_create tool to create a new notebook with the provided name. Keep track of the notebook_id.
Step 3: Upload Sources
- - Loop through all gathered sources:
-
EPUB Files: Convert to
.txt first:
cd ~/Programs/epub2txt && ./run.sh "<path>". Use the new
.txt path.
-
Other Files: Use
source_add(source_type="file", file_path="...").
-
URLs/YouTube: Use
source_add(source_type="url", url="...").
-
Drive: Use
source_add(source_type="drive", document_id="...").
- - Always set
wait=true to ensure sources are processed.
Step 4: Generate Audio Overview
- - Use the
studio_create tool to start the audio generation.
- Set
notebook_id to the ID.
- Set
artifact_type to
audio.
- Set
audio_format to
deep_dive.
- Set
audio_length to
long.
-
Language: Use the user's selected BCP-47 code (e.g.,
zh).
-
Custom Prompt: If the selected language is NOT English (
en), you MUST provide the following
focus_prompt to encourage a longer, more detailed output:
> "Please provide an extremely detailed deep dive. Analyze each source file thoroughly without omitting any details. The conversation should be as long as possible, aiming for over 40 minutes."
- Set
confirm to
true.
Step 5: Monitor Generation Status
- - Inform the user: Explicitly tell the user that generating a long, deep-dive audio overview can take 5 to 15 minutes.
- Use the
studio_status tool with action: status in a polling loop (using run_shell_command with sleep 300 between checks) until the status becomes completed. - Note the
audio_url and artifact_id when finished. Crucial: If there are multiple audio artifacts returned in the status, always identify and note the latest one (the one with the most recent created_at timestamp).
Step 6: Download the Audio
- - Using the
artifact_id of the latest audio, try using the download_artifact tool first to save the audio to the destination path with an .mp3 extension.
Step 7: Final Verification
- - Verify the downloaded file using
file <output_path>. - Inform the user that the process is complete.
NotebookLM 音频生成技能
该技能可自动使用 Google 的 NotebookLM 从多种来源生成深度音频概览,并将其下载到指定目录。
前置条件
本技能依赖 notebooklm-mcp-cli 包和用于支持 .epub 格式的 epub2txt 工具。在继续之前,请确保用户已安装并完成身份验证。
安装与设置
如果用户尚未设置 CLI 或转换工具,请指导他们先完成以下操作:
- 1. 安装 NotebookLM CLI:
bash
uv tool install notebooklm-mcp-cli
# 或
pip install notebooklm-mcp-cli
- 2. 身份验证:
bash
nlm login
- 3. 安装 epub2txt(用于支持 .epub 格式):
本技能要求将 epub2txt 安装在您的程序目录中。使用以下命令克隆并初始化:
bash
mkdir -p ~/Programs
cd ~/Programs
git clone https://github.com/SPACESODA/epub2txt.git
cd epub2txt
chmod +x run.sh
./run.sh # 初始化虚拟环境
工作流程
激活后,请严格按以下步骤顺序执行。不要跳过任何步骤。
步骤 1:收集信息
逐一询问用户以下信息,为生成做准备:
- 1. 询问新笔记本的名称。如果未提供,则使用默认名称音频概览笔记本。
- 来源选择: 让用户从以下选项中选择来源:
-
本地文件: .pdf、.txt 和 .epub(将自动转换)。使用 GUI 选择器:
-
macOS: osascript -e set theFiles to choose file with prompt \请选择您的源文件:\ multiple selections allowed true ...
-
Linux: zenity --file-selection --multiple ...
-
Windows: PowerShell OpenFileDialog。
-
网页/视频网址: 让用户提供任何网站或 YouTube 网址。
-
Google Drive: 询问 Google Drive 文档 ID。
- 3. 首选语言: 询问用户偏好的输出语言(BCP-47 代码)。
-
选项: 提供常用选项:en(英语 - 默认)、zh(中文)、ja(日语)、es(西班牙语)、fr(法语)、de(德语)。
- 4. 下载目标: 使用 GUI 目录选择器选择音频文件的保存位置。
关键: 在继续之前,请与用户交互确认他们已提供/选择了所有希望包含的来源。
步骤 2:创建新笔记本
使用 notebookcreate 工具使用提供的名称创建新笔记本。记录 notebookid。
步骤 3:上传来源
-
EPUB 文件: 先转换为 .txt:cd ~/Programs/epub2txt && ./run.sh <路径>。使用新的 .txt 路径。
-
其他文件: 使用 source
add(sourcetype=file, file_path=...)。
-
网址/YouTube: 使用 source
add(sourcetype=url, url=...)。
-
Drive: 使用 source
add(sourcetype=drive, document_id=...)。
- - 始终设置 wait=true 以确保来源被处理。
步骤 4:生成音频概览
- - 使用 studio_create 工具开始音频生成。
- 将 notebook_id 设置为该 ID。
- 将 artifact_type 设置为 audio。
- 将 audio
format 设置为 deepdive。
- 将 audio_length 设置为 long。
-
语言: 使用用户选择的 BCP-47 代码(例如 zh)。
-
自定义提示: 如果所选语言不是英语(en),则必须提供以下 focus_prompt 以鼓励更长的、更详细的输出:
> 请提供极其详细的深度分析。彻底分析每个源文件,不要遗漏任何细节。对话应尽可能长,目标超过 40 分钟。
- 将 confirm 设置为 true。
步骤 5:监控生成状态
- - 告知用户: 明确告知用户生成长篇深度音频概览可能需要 5 到 15 分钟。
- 使用 studiostatus 工具,在轮询循环中设置 action: status(使用 runshellcommand 并在检查之间设置 sleep 300),直到 status 变为 completed。
- 完成后记录 audiourl 和 artifactid。关键: 如果状态中返回了多个音频产物,始终识别并记录最新的一个(即 createdat 时间戳最近的那个)。
步骤 6:下载音频
- - 使用最新音频的 artifactid,首先尝试使用 downloadartifact 工具将音频以 .mp3 扩展名保存到目标路径。
步骤 7:最终验证
- - 使用 file <输出路径> 验证下载的文件。
- 告知用户过程已完成。