Batch collect the latest video links from a Douyin account homepage, extract video speech copy via douyin-mcp, remove colloquialisms and output concise original copy, and provide a comprehensive summary.
Prerequisites
- browser tool: used to render the Douyin SPA page and scrape the video list (web_fetch is invalid; Douyin is purely JS-rendered)
- mcporter CLI:
which mcporterconfirmed available - douyin-mcp server: in
mcporter listit should showdouyin-mcp (5 tools)
mcporter will automatically load the MCP servers from the two config files
~/.cursor/mcp.jsonand~/.claude.json.
Version and Key reference
| Version | API platform | Environment variable |
|---|---|---|
| ≤ 1.1.0 | SiliconFlow | DOUYIN_API_KEY |
| ≥ 1.2.0 | Alibaba Cloud Model Studio | DASHSCOPE_API_KEY |
Both versions are supported; choose the corresponding environment variable according to the actual configuration. For configuration guide, see references/setup.md。
Workflow steps
Step 1: Check configuration
# 确认 mcporter 和 douyin-mcp 可用
mcporter list 2>&1 | grep douyin-mcp
Read the config file to determine the version and Key:
python3 << 'EOF'
import json, os
# mcporter 同时加载这两个配置
for path in ['~/.cursor/mcp.json', '~/.claude.json']:
p = os.path.expanduser(path)
if not os.path.exists(p): continue
d = json.load(open(p))
cfg = d.get('mcpServers', {}).get('douyin-mcp')
if cfg:
print(f"Found in {path}")
print(' args:', cfg.get('args'))
print(' env keys:', list(cfg.get('env', {}).keys()))
break
EOF
- env contains
DOUYIN_API_KEY→ v1.1.0, SiliconFlow - env contains
DASHSCOPE_API_KEY→ v1.2.0+, Alibaba Cloud Model Studio
If not configured, refer to references/setup.md to complete initialization.
Step 2: Use browser to scrape the video list
Douyin is a pure JS SPA;the browser tool must be used, web_fetch cannot be used.
browser(action="open", profile="openclaw", targetUrl="<账号主页URL>")
browser(action="screenshot", ...) # 等页面渲染,确认视频列表出现
browser(action="snapshot", ...) # 提取 listitem 中的 /video/XXXX 链接
Extract from the snapshot's aria tree link[href=/video/XXXXXXXXXXXXXXXXX], take the first N items, and concatenate the complete links:https://www.douyin.com/video/<video_id>
Step 3: Concurrently extract video copy
According to the version detected in Step 1, choose the corresponding environment variable name,concurrentlycall all videos (do not wait serially):
# v1.1.0(硅基流动)
DOUYIN_API_KEY="<key>" mcporter call douyin-mcp.extract_douyin_text \
share_link="https://www.douyin.com/video/<video_id>" 2>&1
# v1.2.0+(阿里云百炼)
DASHSCOPE_API_KEY="<key>" mcporter call douyin-mcp.extract_douyin_text \
share_link="https://www.douyin.com/video/<video_id>" 2>&1
Initiate all exec calls at the same time (place them in the same tool call block), set timeout=180,yieldMs=120000。
If an error occurs, refer to references/troubleshooting.md。
Step 4: Organize and output
Output in video order (newest to oldest), each video includes:
- Video title(from the snapshot's link text)
- Video link
- Concise copy: remove colloquial expressions from the original speech copy (remove filler words, repetitive verbosity, and colloquial filler such as "everyone"/"we"/"you"), keep the core information and arguments, present as written paragraphs, do not summarize or compress, fully retain all key points
Finally append a comprehensive summary: summarize the main logic, core themes, and consistent risk warnings across videos.
Output format reference
## 📊 [账号名] 最近 N 条视频文案整理
---
### 视频1 | <标题>
🔗 <链接>
<精简后的书面化文案,完整保留所有要点,去除口语填充>
---
### 视频2 | <标题>
...
---
## 🗂️ 综合总结
| 主线 | 核心逻辑 | 重点方向 |
|------|----------|----------|
| ... | ... | ... |
Notes
- When the Douyin login popup appears: read the snapshot directly; the video list can usually still be obtained from the aria tree
- The first video may require login to access; from the second one onward it is usually normal
- extract_douyin_text takes a long time (30~90s per item), so be sure to execute concurrently
- If copy extraction fails, you can first use
parse_douyin_video_infoto get the download link, then process manually