feat: 新增抖音(Douyin)渠道 - 基于 douyin-mcp-server
- 新增 agent_reach/channels/douyin.py - 更新 doctor 检测逻辑 - 更新 install.md/SKILL.md/README 文档 - 通过 mcporter 调用 douyin-mcp-server - 支持视频解析、下载链接获取 - 无需登录即可使用
This commit is contained in:
@@ -16,6 +16,7 @@ from .rss import RSSChannel
|
||||
from .bilibili import BilibiliChannel
|
||||
from .exa_search import ExaSearchChannel
|
||||
from .xiaohongshu import XiaoHongShuChannel
|
||||
from .douyin import DouyinChannel
|
||||
from .linkedin import LinkedInChannel
|
||||
from .bosszhipin import BossZhipinChannel
|
||||
|
||||
@@ -28,6 +29,7 @@ ALL_CHANNELS: List[Channel] = [
|
||||
RedditChannel(),
|
||||
BilibiliChannel(),
|
||||
XiaoHongShuChannel(),
|
||||
DouyinChannel(),
|
||||
LinkedInChannel(),
|
||||
BossZhipinChannel(),
|
||||
RSSChannel(),
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Douyin (抖音) — check if mcporter + douyin-mcp-server is available."""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
from .base import Channel
|
||||
|
||||
|
||||
class DouyinChannel(Channel):
|
||||
name = "douyin"
|
||||
description = "抖音短视频"
|
||||
backends = ["douyin-mcp-server"]
|
||||
tier = 2
|
||||
|
||||
def can_handle(self, url: str) -> bool:
|
||||
from urllib.parse import urlparse
|
||||
d = urlparse(url).netloc.lower()
|
||||
return "douyin.com" in d or "iesdouyin.com" in d
|
||||
|
||||
def check(self, config=None):
|
||||
if not shutil.which("mcporter"):
|
||||
return "off", (
|
||||
"需要 mcporter + douyin-mcp-server。安装步骤:\n"
|
||||
" 1. npm install -g mcporter\n"
|
||||
" 2. pip install douyin-mcp-server\n"
|
||||
" 3. 启动服务(见下方说明)\n"
|
||||
" 4. mcporter config add douyin http://localhost:18070/mcp\n"
|
||||
" 详见 https://github.com/yzfly/douyin-mcp-server"
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
["mcporter", "list"], capture_output=True, text=True, timeout=10
|
||||
)
|
||||
if "douyin" not in r.stdout:
|
||||
return "off", (
|
||||
"mcporter 已装但抖音 MCP 未配置。运行:\n"
|
||||
" pip install douyin-mcp-server\n"
|
||||
" # 启动服务后:\n"
|
||||
" mcporter config add douyin http://localhost:18070/mcp"
|
||||
)
|
||||
except Exception:
|
||||
return "off", "mcporter 连接异常"
|
||||
try:
|
||||
r = subprocess.run(
|
||||
["mcporter", "call", "douyin.parse_douyin_video_info(share_link: \"https://www.douyin.com\")"],
|
||||
capture_output=True, text=True, timeout=15
|
||||
)
|
||||
if r.returncode == 0:
|
||||
return "ok", "完整可用(视频解析、下载链接获取)"
|
||||
return "warn", "MCP 已连接但调用异常,检查 douyin-mcp-server 服务是否在运行"
|
||||
except Exception:
|
||||
return "warn", "MCP 连接异常,检查 douyin-mcp-server 服务是否在运行"
|
||||
@@ -3,7 +3,7 @@ name: agent-reach
|
||||
description: >
|
||||
Give your AI agent eyes to see the entire internet. Install and configure
|
||||
upstream tools for Twitter/X, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu,
|
||||
LinkedIn, Boss直聘, RSS, and any web page — then call them directly.
|
||||
Douyin, LinkedIn, Boss直聘, RSS, and any web page — then call them directly.
|
||||
Use when: (1) setting up platform access tools for the first time,
|
||||
(2) checking which platforms are available,
|
||||
(3) user asks to configure/enable a platform channel.
|
||||
@@ -144,6 +144,21 @@ mcporter call 'xiaohongshu.get_feed_comments(feed_id: "xxx", xsec_token: "yyy")'
|
||||
mcporter call 'xiaohongshu.create_image_feed(title: "标题", desc: "内容", image_paths: ["/path/to/img.jpg"])'
|
||||
```
|
||||
|
||||
### 抖音 / Douyin (mcporter + douyin-mcp-server)
|
||||
|
||||
```bash
|
||||
# 解析抖音视频信息(分享链接 → 标题、作者、无水印视频URL等)
|
||||
mcporter call 'douyin.parse_douyin_video_info(share_link: "https://v.douyin.com/xxx/")'
|
||||
|
||||
# 获取无水印视频下载链接
|
||||
mcporter call 'douyin.get_douyin_download_link(share_link: "https://v.douyin.com/xxx/")'
|
||||
|
||||
# AI 提取视频语音文案(需要配置硅基流动 API Key)
|
||||
mcporter call 'douyin.extract_douyin_text(share_link: "https://v.douyin.com/xxx/")'
|
||||
```
|
||||
|
||||
> 无需登录即可解析视频。支持抖音分享链接和直接链接。
|
||||
|
||||
### GitHub (gh CLI)
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user