Loading...
Loading...
Compare original and translation side by side
pip install notebooklm-pyundefinedpip install notebooklm-pyundefined
⚠️ **DO NOT install from main branch** (`pip install git+https://github.com/teng-lin/notebooklm-py`). The main branch may contain unreleased/unstable changes. Always use PyPI or a specific release tag, unless you are testing unreleased features.
After installation, install the Claude Code skill:
```bash
notebooklm skill install
⚠️ **请勿从main分支安装**(`pip install git+https://github.com/teng-lin/notebooklm-py`)。main分支可能包含未发布/不稳定的更改。除非您在测试未发布功能,否则请始终使用PyPI或特定发布标签。
安装完成后,安装Claude Code技能:
```bash
notebooklm skill installnotebooklm login # Opens browser for Google OAuth
notebooklm list # Verify authentication worksnotebooklm loginnotebooklm login # 打开浏览器进行Google OAuth验证
notebooklm list # 验证身份验证是否成功notebooklm login| Variable | Purpose |
|---|---|
| Custom config directory (default: |
| Inline auth JSON - no file writes needed |
NOTEBOOKLM_AUTH_JSONstorage_state.jsonNOTEBOOKLM_HOME~/.notebooklm/context.jsonnotebooklm use-n <notebook_id>waitdownload--notebook <notebook_id>useNOTEBOOKLM_HOMEexport NOTEBOOKLM_HOME=/tmp/agent-$ID| 变量 | 用途 |
|---|---|
| 自定义配置目录(默认: |
| 内联身份验证JSON - 无需写入文件 |
storage_state.jsonNOTEBOOKLM_AUTH_JSONNOTEBOOKLM_HOME~/.notebooklm/context.jsonnotebooklm use-n <notebook_id>waitdownload--notebook <notebook_id>useNOTEBOOKLM_HOMEexport NOTEBOOKLM_HOME=/tmp/agent-$IDnotebooklm statusnotebooklm list --jsonnotebooklm loginnotebooklm statusnotebooklm list --jsonnotebooklm loginnotebooklm statusnotebooklm auth checknotebooklm listnotebooklm source listnotebooklm artifact listnotebooklm language listnotebooklm language getnotebooklm language setnotebooklm artifact waitnotebooklm source waitnotebooklm research statusnotebooklm research waitnotebooklm use <id>-nnotebooklm createnotebooklm ask "..."notebooklm source addnotebooklm deletenotebooklm generate *notebooklm download *notebooklm artifact waitnotebooklm source waitnotebooklm research waitnotebooklm statusnotebooklm auth checknotebooklm listnotebooklm source listnotebooklm artifact listnotebooklm language listnotebooklm language getnotebooklm language setnotebooklm artifact waitnotebooklm source waitnotebooklm research statusnotebooklm research waitnotebooklm use <id>-nnotebooklm createnotebooklm ask "..."notebooklm source addnotebooklm deletenotebooklm generate *notebooklm download *notebooklm artifact waitnotebooklm source waitnotebooklm research wait| Task | Command |
|---|---|
| Authenticate | |
| Diagnose auth issues | |
| Diagnose auth (full) | |
| List notebooks | |
| Create notebook | |
| Set context | |
| Show context | |
| Add URL source | |
| Add file | |
| Add YouTube | |
| List sources | |
| Wait for source processing | |
| Web research (fast) | |
| Web research (deep) | |
| Check research status | |
| Wait for research | |
| Chat | |
| Chat (new conversation) | |
| Chat (specific sources) | |
| Chat (with references) | |
| Get source fulltext | |
| Get source guide | |
| Generate podcast | |
| Generate podcast (JSON) | |
| Generate podcast (specific sources) | |
| Generate video | |
| Generate quiz | |
| Check artifact status | |
| Wait for completion | |
| Download audio | |
| Download video | |
| Download report | |
| Download mind map | |
| Download data table | |
| Download quiz | |
| Download quiz (markdown) | |
| Download flashcards | |
| Download flashcards (markdown) | |
| Delete notebook | |
| List languages | |
| Get language | |
| Set language | |
-nartifact waitsource waitresearch wait/statusdownload *-a/--artifact--notebook--newusedeletewait| 任务 | 命令 |
|---|---|
| 身份验证 | |
| 诊断身份验证问题 | |
| 完整身份验证诊断 | |
| 列出笔记本 | |
| 创建笔记本 | |
| 设置上下文 | |
| 显示上下文 | |
| 添加URL来源 | |
| 添加文件 | |
| 添加YouTube来源 | |
| 列出来源 | |
| 等待来源处理完成 | |
| 快速网页研究 | |
| 深度网页研究 | |
| 检查研究状态 | |
| 等待研究完成 | |
| 聊天 | |
| 新对话聊天 | |
| 指定来源聊天 | |
| 带引用的聊天 | |
| 获取来源全文 | |
| 获取来源指南 | |
| 生成播客 | |
| 生成播客(JSON格式) | |
| 指定来源生成播客 | |
| 生成视频 | |
| 生成测验 | |
| 检查成果物状态 | |
| 等待完成 | |
| 下载音频 | |
| 下载视频 | |
| 下载报告 | |
| 下载思维导图 | |
| 下载数据表 | |
| 下载测验 | |
| 下载测验(markdown格式) | |
| 下载抽认卡 | |
| 下载抽认卡(markdown格式) | |
| 删除笔记本 | |
| 列出支持语言 | |
| 获取当前语言 | |
| 设置语言 | |
-nartifact waitsource waitresearch wait/statusdownload *-a/--artifact--notebook--newusedeletewait--json$ notebooklm create "Research" --json
{"id": "abc123de-...", "title": "Research"}$ notebooklm source add "https://example.com" --json
{"source_id": "def456...", "title": "Example", "status": "processing"}$ notebooklm generate audio "Focus on key points" --json
{"task_id": "xyz789...", "status": "pending"}$ notebooklm ask "What is X?" --json
{"answer": "X is... [1] [2]", "conversation_id": "...", "turn_number": 1, "is_follow_up": false, "references": [{"source_id": "abc123...", "citation_number": 1, "cited_text": "Relevant passage from source..."}, {"source_id": "def456...", "citation_number": 2, "cited_text": "Another passage..."}]}$ notebooklm source fulltext <source_id> --json
{"source_id": "...", "title": "...", "char_count": 12345, "content": "Full indexed text..."}cited_textstart_charend_charSourceFulltext.find_citation_context()fulltext = await client.sources.get_fulltext(notebook_id, ref.source_id)
matches = fulltext.find_citation_context(ref.cited_text) # Returns list[(context, position)]
if matches:
context, pos = matches[0] # First match; check len(matches) > 1 for duplicatesidsource_idtask_id--json$ notebooklm create "Research" --json
{"id": "abc123de-...", "title": "Research"}$ notebooklm source add "https://example.com" --json
{"source_id": "def456...", "title": "Example", "status": "processing"}$ notebooklm generate audio "Focus on key points" --json
{"task_id": "xyz789...", "status": "pending"}$ notebooklm ask "What is X?" --json
{"answer": "X is... [1] [2]", "conversation_id": "...", "turn_number": 1, "is_follow_up": false, "references": [{"source_id": "abc123...", "citation_number": 1, "cited_text": "Relevant passage from source..."}, {"source_id": "def456...", "citation_number": 2, "cited_text": "Another passage..."}]}$ notebooklm source fulltext <source_id> --json
{"source_id": "...", "title": "...", "char_count": 12345, "content": "Full indexed text..."}cited_textstart_charend_charSourceFulltext.find_citation_context()fulltext = await client.sources.get_fulltext(notebook_id, ref.source_id)
matches = fulltext.find_citation_context(ref.cited_text) # 返回列表[(context, position)]
if matches:
context, pos = matches[0] # 第一个匹配项;如果matches长度>1则检查重复idsource_idtask_id-s, --source--language--jsontask_idstatus--retry N| Type | Command | Options | Download |
|---|---|---|---|
| Podcast | | | .mp3 |
| Video | | | .mp4 |
| Slide Deck | | | |
| Infographic | | | .png |
| Report | | | .md |
| Mind Map | | (sync, instant) | .json |
| Data Table | | description required | .csv |
| Quiz | | | .json/.md/.html |
| Flashcards | | | .json/.md/.html |
-s, --source--language--jsontask_idstatus--retry N| 类型 | 命令 | 选项 | 下载格式 |
|---|---|---|---|
| 播客 | | | .mp3 |
| 视频 | | | .mp4 |
| 幻灯片 | | | |
| 信息图 | | | .png |
| 报告 | | | .md |
| 思维导图 | | 同步,即时生成 | .json |
| 数据表 | | 需要描述 | .csv |
| 测验 | | | .json/.md/.html |
| 抽认卡 | | | .json/.md/.html |
| Feature | Command | Description |
|---|---|---|
| Batch downloads | | Download all artifacts of a type at once |
| Quiz/Flashcard export | | Export as JSON, Markdown, or HTML (web UI only shows interactive view) |
| Mind map extraction | | Export hierarchical JSON for visualization tools |
| Data table export | | Download structured tables as CSV |
| Source fulltext | | Retrieve the indexed text content of any source |
| Programmatic sharing | | Manage sharing permissions without the UI |
| 功能 | 命令 | 描述 |
|---|---|---|
| 批量下载 | | 一次性下载所有指定类型的成果物 |
| 测验/抽认卡导出 | | 导出为JSON、Markdown或HTML格式(网页UI仅显示交互式视图) |
| 思维导图提取 | | 导出分层JSON格式以便在可视化工具中使用 |
| 数据表导出 | | 以CSV格式下载结构化表格 |
| 来源全文获取 | | 获取任何来源的索引文本内容 |
| 程序化共享 | | 无需UI即可管理共享权限 |
notebooklm create "Research: [topic]"notebooklm loginnotebooklm source addnotebooklm source list --jsonnotebooklm generate audio "Focus on [specific angle]"notebooklm artifact listnotebooklm download audio ./podcast.mp3notebooklm create "Research: [topic]"notebooklm loginnotebooklm source addnotebooklm source list --jsonnotebooklm generate audio "Focus on [specific angle]"notebooklm artifact listnotebooklm download audio ./podcast.mp3source waitsource list --jsonnotebooklm generate audio "..." --jsonartifact_idTask(
prompt="Wait for artifact {artifact_id} in notebook {notebook_id} to complete, then download.
Use: notebooklm artifact wait {artifact_id} -n {notebook_id} --timeout 600
Then: notebooklm download audio ./podcast.mp3 -a {artifact_id} -n {notebook_id}",
subagent_type="general-purpose"
)artifact waitartifact listsource waitsource list --jsonnotebooklm generate audio "..." --jsonartifact_idTask(
prompt="等待笔记本{notebook_id}中的成果物{artifact_id}完成,然后下载。
使用命令:notebooklm artifact wait {artifact_id} -n {notebook_id} --timeout 600
然后运行:notebooklm download audio ./podcast.mp3 -a {artifact_id} -n {notebook_id}",
subagent_type="general-purpose"
)artifact waitartifact listnotebooklm create "Analysis: [project]"notebooklm source add ./doc.pdfnotebooklm ask "Summarize the key points"notebooklm ask "What are the main arguments?"notebooklm create "Analysis: [project]"notebooklm source add ./doc.pdfnotebooklm ask "Summarize the key points"notebooklm ask "What are the main arguments?"notebooklm create "Collection: [name]"notebooklm source add "https://url1.com"
notebooklm source add "https://url2.com"
notebooklm source add ./local-file.pdfnotebooklm source listnotebooklm create "Collection: [name]"notebooklm source add "https://url1.com"
notebooklm source add "https://url2.com"
notebooklm source add ./local-file.pdfnotebooklm source list--jsonnotebooklm source add "https://url1.com" --json # → {"source_id": "abc..."}
notebooklm source add "https://url2.com" --json # → {"source_id": "def..."}Task(
prompt="Wait for sources {source_ids} in notebook {notebook_id} to be ready.
For each: notebooklm source wait {id} -n {notebook_id} --timeout 120
Report when all ready or if any fail.",
subagent_type="general-purpose"
)--jsonnotebooklm source add "https://url1.com" --json # → {"source_id": "abc..."}
notebooklm source add "https://url2.com" --json # → {"source_id": "def..."}Task(
prompt="等待笔记本{notebook_id}中的来源{source_ids}处理完成。
对每个来源运行:notebooklm source wait {id} -n {notebook_id} --timeout 120
当所有来源就绪或有任何失败时进行报告。",
subagent_type="general-purpose"
)notebooklm create "Research: [topic]"notebooklm source add-research "topic query" --mode deep --no-waitTask(
prompt="Wait for research in notebook {notebook_id} to complete and import sources.
Use: notebooklm research wait -n {notebook_id} --import-all --timeout 300
Report how many sources were imported.",
subagent_type="general-purpose"
)--no-waitnotebooklm source add-research "topic" --mode deep --import-allnotebooklm create "Research: [topic]"notebooklm source add-research "topic query" --mode deep --no-waitTask(
prompt="等待笔记本{notebook_id}中的研究完成并导入来源。
使用命令:notebooklm research wait -n {notebook_id} --import-all --timeout 300
报告导入的来源数量。",
subagent_type="general-purpose"
)--no-waitnotebooklm source add-research "topic" --mode deep --import-all
**When to use each mode:**
- `--mode fast`: Specific topic, quick overview needed (5-10 sources, seconds)
- `--mode deep`: Broad topic, comprehensive analysis needed (20+ sources, 2-5 min)
**Research sources:**
- `--from web`: Search the web (default)
- `--from drive`: Search Google Drive
**何时使用不同模式:**
- `--mode fast`:特定主题,需要快速概述(5-10个来源,数秒完成)
- `--mode deep`:广泛主题,需要全面分析(20+个来源,2-5分钟完成)
**研究来源:**
- `--from web`:搜索网页(默认)
- `--from drive`:搜索Google Driveartifact wait--jsonnotebooklm list --json
notebooklm auth check --json
notebooklm source list --json
notebooklm artifact list --jsonnotebooklm list --json{"notebooks": [{"id": "...", "title": "...", "created_at": "..."}]}notebooklm auth check --json{"checks": {"storage_exists": true, "json_valid": true, "cookies_present": true, "sid_cookie": true, "token_fetch": true}, "details": {"storage_path": "...", "auth_source": "file", "cookies_found": ["SID", "HSID", "..."], "cookie_domains": [".google.com"]}}notebooklm source list --json{"sources": [{"id": "...", "title": "...", "status": "ready|processing|error"}]}notebooklm artifact list --json{"artifacts": [{"id": "...", "title": "...", "type": "Audio Overview", "status": "in_progress|pending|completed|unknown"}]}processingreadyerrorpendingin_progresscompletedunknownartifact wait--jsonnotebooklm list --json
notebooklm auth check --json
notebooklm source list --json
notebooklm artifact list --jsonnotebooklm list --json{"notebooks": [{"id": "...", "title": "...", "created_at": "..."}]}notebooklm auth check --json{"checks": {"storage_exists": true, "json_valid": true, "cookies_present": true, "sid_cookie": true, "token_fetch": true}, "details": {"storage_path": "...", "auth_source": "file", "cookies_found": ["SID", "HSID", "..."], "cookie_domains": [".google.com"]}}notebooklm source list --json{"sources": [{"id": "...", "title": "...", "status": "ready|processing|error"}]}notebooklm artifact list --json{"artifacts": [{"id": "...", "title": "...", "type": "Audio Overview", "status": "in_progress|pending|completed|unknown"}]}processingreadyerrorpendingin_progresscompletedunknown| Error | Cause | Action |
|---|---|---|
| Auth/cookie error | Session expired | Run |
| "No notebook context" | Context not set | Use |
| "No result found for RPC ID" | Rate limiting | Wait 5-10 min, retry |
| Google rate limit | Wait and retry later |
| Download fails | Generation incomplete | Check |
| Invalid notebook/source ID | Wrong ID | Run |
| RPC protocol error | Google changed APIs | May need CLI update |
| 错误 | 原因 | 操作 |
|---|---|---|
| 身份验证/ cookie错误 | 会话过期 | 运行 |
| "No notebook context" | 未设置上下文 | 使用 |
| "No result found for RPC ID" | 速率限制 | 等待5-10分钟后重试 |
| Google速率限制 | 稍后等待并重试 |
| 下载失败 | 生成未完成 | 检查 |
| 无效的笔记本/来源ID | ID错误 | 运行 |
| RPC协议错误 | Google更改了API | 可能需要更新CLI |
| Code | Meaning | Action |
|---|---|---|
| 0 | Success | Continue |
| 1 | Error (not found, processing failed) | Check stderr, see Error Handling |
| 2 | Timeout (wait commands only) | Extend timeout or check status manually |
source waitartifact waitgenerate| 代码 | 含义 | 操作 |
|---|---|---|
| 0 | 成功 | 继续 |
| 1 | 错误(未找到、处理失败) | 检查stderr,参考错误处理部分 |
| 2 | 超时(仅wait命令) | 延长超时时间或手动检查状态 |
source waitartifact waitgeneratenotebooklm artifact list| Operation | Typical time | Suggested timeout |
|---|---|---|
| Source processing | 30s - 10 min | 600s |
| Research (fast) | 30s - 2 min | 180s |
| Research (deep) | 15 - 30+ min | 1800s |
| Notes | instant | n/a |
| Mind-map | instant (sync) | n/a |
| Quiz, flashcards | 5 - 15 min | 900s |
| Report, data-table | 5 - 15 min | 900s |
| Audio generation | 10 - 20 min | 1200s |
| Video generation | 15 - 45 min | 2700s |
notebooklm artifact list| 操作 | 典型时间 | 建议超时时间 |
|---|---|---|
| 来源处理 | 30秒 - 10分钟 | 600秒 |
| 快速研究 | 30秒 - 2分钟 | 180秒 |
| 深度研究 | 15 - 30+分钟 | 1800秒 |
| 笔记 | 即时 | 不适用 |
| 思维导图 | 即时(同步) | 不适用 |
| 测验、抽认卡 | 5 - 15分钟 | 900秒 |
| 报告、数据表 | 5 - 15分钟 | 900秒 |
| 音频生成 | 10 - 20分钟 | 1200秒 |
| 视频生成 | 15 - 45分钟 | 2700秒 |
undefinedundefined
**Common language codes:**
| Code | Language |
|------|----------|
| `en` | English |
| `zh_Hans` | 中文(简体) - Simplified Chinese |
| `zh_Hant` | 中文(繁體) - Traditional Chinese |
| `ja` | 日本語 - Japanese |
| `ko` | 한국어 - Korean |
| `es` | Español - Spanish |
| `fr` | Français - French |
| `de` | Deutsch - German |
| `pt_BR` | Português (Brasil) |
**Override per command:** Use `--language` flag on generate commands:
```bash
notebooklm generate audio --language ja # Japanese podcast
notebooklm generate video --language zh_Hans # Chinese video--localnotebooklm language set zh_Hans --local # Save locally only
notebooklm language get --local # Read local config only
**常用语言代码:**
| 代码 | 语言 |
|------|----------|
| `en` | 英语 |
| `zh_Hans` | 中文(简体) |
| `zh_Hant` | 中文(繁體) |
| `ja` | 日本語 |
| `ko` | 한국어 |
| `es` | Español - 西班牙语 |
| `fr` | Français - 法语 |
| `de` | Deutsch - 德语 |
| `pt_BR` | Português (Brasil) - 巴西葡萄牙语 |
**按命令覆盖:**在生成命令中使用`--language`标志:
```bash
notebooklm generate audio --language ja # 日语播客
notebooklm generate video --language zh_Hans # 中文视频--localnotebooklm language set zh_Hans --local # 仅本地保存
notebooklm language get --local # 仅读取本地配置notebooklm --help # Main commands
notebooklm auth check # Diagnose auth issues
notebooklm auth check --test # Full auth validation with network test
notebooklm notebook --help # Notebook management
notebooklm source --help # Source management
notebooklm research --help # Research status/wait
notebooklm generate --help # Content generation
notebooklm artifact --help # Artifact management
notebooklm download --help # Download content
notebooklm language --help # Language settingsnotebooklm auth checknotebooklm loginnotebooklm --versionnotebooklm skill installnotebooklm --help # 主命令帮助
notebooklm auth check # 诊断身份验证问题
notebooklm auth check --test # 完整身份验证验证(含网络测试)
notebooklm notebook --help # 笔记本管理帮助
notebooklm source --help # 来源管理帮助
notebooklm research --help # 研究状态/等待帮助
notebooklm generate --help # 内容生成帮助
notebooklm artifact --help # 成果物管理帮助
notebooklm download --help # 内容下载帮助
notebooklm language --help # 语言设置帮助notebooklm auth checknotebooklm loginnotebooklm --versionnotebooklm skill install