This repository has been archived on 2026-08-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kb-skills/kb-zhihu-content/SKILL.md
T
starmen1265 9259a3731a feat: 添加知乎视频支持
新增:
- 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 知乎视频处理流程
  - 更新子技能清单,添加知乎视频条目
  - 更新内容类型判断表格
2026-02-16 22:19:25 +08:00

59 lines
1.4 KiB
Markdown

# 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_COOKIE` environment variable
## Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `ZHIHU_COOKIE` | No | 知乎登录 Cookie (for member-only videos) |
## Commands
```bash
# 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
```json
{
"success": true,
"type": "video",
"filename": "video_title.mp4",
"filepath": "/path/to/downloads/video_title.mp4",
"message": "下载完成: video_title.mp4"
}
```
## Installation
```bash
# Already included in kb-skills repo
# Ensure yt-dlp is installed
pip install yt-dlp aiohttp
```
## How It Works
Video download uses **yt-dlp**:
1. Parses `ZHIHU_COOKIE` environment variable (optional)
2. Creates temporary Netscape-format cookie file
3. Runs `yt-dlp -f best -o <output> <url>`
4. Cleans up temporary file
## Notes
- 知乎视频通常没有官方字幕,将自动触发 Whisper 语音识别
- 视频下载需要能访问知乎(可能需要代理)