9259a3731a
新增: - kb-zhihu-content/: 知乎视频下载模块 - zhihu_content.py: 视频下载工具(使用 yt-dlp) - SKILL.md: 技能说明文档 修改: - kb_workflow.py: - CONTENT_AGENTS 添加 zhihu - VIDEO_CONTENT_TYPES 添加 zvideo - SKILL.md: - 添加 4.1.2 知乎视频处理流程 - 更新子技能清单,添加知乎视频条目 - 更新内容类型判断表格
1.4 KiB
1.4 KiB
KB Zhihu Content Skill
kb-zhihu-content - Download Zhihu videos and extract content.
Features
- Video download using yt-dlp
- Subtitle extraction (returns no subtitle, triggers Whisper)
- Supports
ZHIHU_COOKIEenvironment variable
Environment Variables
| Variable | Required | Description |
|---|---|---|
ZHIHU_COOKIE |
No | 知乎登录 Cookie (for member-only videos) |
Commands
# Download video
python zhihu_content.py --id "12345678" --type video --output "/path/to/downloads/"
# Extract subtitle (returns no subtitle, triggers Whisper)
python zhihu_content.py --id "12345678" --type subtitle --output "/path/to/subtitles/"
Output
{
"success": true,
"type": "video",
"filename": "video_title.mp4",
"filepath": "/path/to/downloads/video_title.mp4",
"message": "下载完成: video_title.mp4"
}
Installation
# Already included in kb-skills repo
# Ensure yt-dlp is installed
pip install yt-dlp aiohttp
How It Works
Video download uses yt-dlp:
- Parses
ZHIHU_COOKIEenvironment variable (optional) - Creates temporary Netscape-format cookie file
- Runs
yt-dlp -f best -o <output> <url> - Cleans up temporary file
Notes
- 知乎视频通常没有官方字幕,将自动触发 Whisper 语音识别
- 视频下载需要能访问知乎(可能需要代理)