抖音无水印视频文本提取 MCP 服务器
一个基于 Model Context Protocol (MCP) 的服务器,可以从抖音分享链接下载无水印视频,提取音频并转换为文本。
功能特性
- 🎵 从抖音分享链接获取无水印视频
- 🎧 自动提取视频音频
- 📝 使用AI语音识别提取文本内容
- 🧹 自动清理中间临时文件
- 🔧 支持自定义API配置
安装
使用 uvx 安装(推荐)
uvx douyin-wenan-mcp-server
使用 pip 安装
pip install douyin-wenan-mcp-server
使用方法
1. 启动服务器
douyin-wenan-mcp-server
2. 在Claude Desktop中配置
在你的 claude_desktop_config.json 中添加:
{
"mcpServers": {
"douyin-wenan": {
"command": "uvx",
"args": ["douyin-wenan-mcp-server"],
"env": {
"DOUYIN_API_KEY": "your-api-key-here"
}
}
}
}
3. 使用MCP工具
获取无水印下载链接
使用 get_douyin_download_link 工具:
# 在Claude中使用,无需API密钥
get_douyin_download_link("https://v.douyin.com/xxx")
提取视频文本
使用 extract_douyin_text 工具(需要设置环境变量 DOUYIN_API_KEY):
# 在Claude中使用
extract_douyin_text("https://v.douyin.com/xxx")
解析视频信息
使用 parse_douyin_video_info 工具:
parse_douyin_video_info("https://v.douyin.com/xxx")
API 配置
默认配置
服务器默认使用 SiliconFlow API:
- API URL:
https://api.siliconflow.cn/v1/audio/transcriptions - 模型:
FunAudioLLM/SenseVoiceSmall
自定义配置
你可以自定义API配置:
extract_douyin_text(
share_link="your-douyin-link",
api_base_url="https://your-custom-api.com/transcriptions",
model="your-custom-model"
)
环境变量配置
在Claude Desktop的配置文件中设置环境变量:
{
"mcpServers": {
"douyin-wenan": {
"command": "uvx",
"args": ["douyin-wenan-mcp-server"],
"env": {
"DOUYIN_API_KEY": "sk-your-api-key-here"
}
}
}
}
工具说明
get_douyin_download_link
获取抖音视频的无水印下载链接,无需API密钥。
参数:
share_link: 抖音分享链接或包含链接的文本
返回:
- 包含下载链接和视频信息的JSON格式数据
extract_douyin_text
完整的文本提取工具,执行以下步骤:
- 解析抖音分享链接
- 下载无水印视频
- 提取音频
- 转换音频为文本
- 清理临时文件
参数:
share_link: 抖音分享链接或包含链接的文本api_base_url: API基础URL(可选)model: 语音识别模型(可选)
环境变量:
DOUYIN_API_KEY: 语音识别API密钥(必需)
parse_douyin_video_info
仅解析视频基本信息,不下载视频。
参数:
share_link: 抖音分享链接
资源访问
douyin://video/{video_id}: 通过视频ID获取详细信息
依赖要求
- Python 3.8+
- ffmpeg(系统需要安装ffmpeg)
- requests
- ffmpeg-python
- tqdm
- mcp
安装 ffmpeg
macOS
brew install ffmpeg
Ubuntu/Debian
sudo apt update
sudo apt install ffmpeg
Windows
下载并安装 ffmpeg
开发
本地开发
git clone https://github.com/yzfly/douyin-wenan-mcp-server.git
cd douyin-wenan-mcp-server
pip install -e .
运行测试
python -m douyin_wenan_mcp_server.server
注意事项
- 确保系统已安装 ffmpeg
- 需要在环境变量中设置有效的语音识别API密钥
DOUYIN_API_KEY - 获取下载链接功能无需API密钥
- 中间文件会自动清理,不会占用磁盘空间
- 支持大部分抖音视频格式
许可证
MIT License
作者
- yzfly - yz.liu.me@gmail.com
- GitHub: https://github.com/yzfly
贡献
欢迎提交 Issue 和 Pull Request!
更新日志
v0.1.0
- 初始版本
- 支持抖音视频文本提取
- 支持获取无水印视频下载链接
- 从环境变量读取API密钥
- 自动清理临时文件
- 支持自定义API配置
Metadata
Release files for douyin-wenan-mcp-server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| douyin_wenan_mcp_server-0.1.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| douyin_wenan_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / douyin_wenan_mcp_server-0.1.0.tar.gz
| Download URL | douyin_wenan_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7cc3b927f75492c40939ea08f4dde24dbd8f5aa9851ec2652d0b79417949886
|
|
BLAKE2b-256 checksum How to use checksums |
567bafda659379cccc17a6d6fdc0f4b4273115dadf0bfce96ebdf3e2567b5757
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / douyin_wenan_mcp_server-0.1.0-py3-none-any.whl
| Download URL | douyin_wenan_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9246692406804f65b4931dc55cba267e7431f815e3bac131f0a8be076eb8f7ce
|
|
BLAKE2b-256 checksum How to use checksums |
b1f2e8582c3bea68e5614910aabd0c2c520cb849ffa33b0e8829a484997cd9e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|