← Back to Skills Marketplace
mars82311111

Douyin Comment Bot

by mars82311111 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
171
Downloads
1
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install douyin-comment
Description
在抖音(douyin.com)上搜索指定关键词的热门视频并发布评论。当用户说「抖音评论」「在抖音上搜 XX 发评论」「抖音互动」「执行:抖音 XX 热门 N 条评论」等涉及抖音搜索+评论的任务时触发本 skill。
README (SKILL.md)

抖音搜索 + 评论 Skill

在托管浏览器(profile=openclaw)中完成:搜索关键词 → 选热门视频 → 发布评论。

⚠️ 核心原则

  1. 禁止 screenshot(无 vision 权限)
  2. 最多 3-4 次 browser 调用完成整个流程,避免超时
  3. 合并操作:用单个 evaluate 完成多步操作

前置条件

  • 浏览器 profile openclaw 已启动且已登录抖音账号

异常处理

Gateway 超时处理

如果 browser 工具返回 timed out 错误,自动重启 Gateway(无需询问用户):

pkill -f "node.*openclaw.*gateway" || true
sleep 3
openclaw gateway status  # 验证重启成功(RPC probe: ok)

然后继续执行任务。

精简流程(3 步完成)

Step 1: 搜索并获取视频ID

一次调用完成搜索 + 提取视频信息:

browser navigate url=https://www.douyin.com/search/关键词?type=video profile=openclaw

然后用 一个 evaluate 提取视频列表:

(() => {
  const text = document.body.innerText;
  // 提取 modal_id 或视频信息
  const videos = [];
  const cards = document.querySelectorAll('li, [class*="card"]');
  cards.forEach((c, i) => {
    const t = c.innerText;
    if (t && t.length > 20 && !t.includes('京ICP')) {
      const plays = t.match(/([\d.]+万?)\
/);
      videos.push({ idx: i, preview: t.slice(0, 80), plays: plays?.[1] });
    }
  });
  return videos.slice(0, 5);
})()

从返回结果中选择播放量最高的视频。

Step 2: 进入视频详情页 + 输入评论

直接导航到视频详情页(比点击弹窗更稳定):

browser navigate url=https://www.douyin.com/video/视频ID profile=openclaw

等待 3-4 秒让页面完全加载,然后用 snapshot 获取评论输入框的 ref:

browser snapshot labels=false profile=openclaw

找到评论输入框(通常是 combobox 类型,内容为"留下你的精彩评论吧")。

Step 3: 输入评论(关键:必须用 slowly type)

⚠️ 重要:必须用 browser act type slowly 输入文本

抖音评论框使用 Draft.js,普通的 evaluate/execCommand 插入文本会导致内部状态不同步,发送按钮保持禁用。

browser act kind=click ref=评论框ref profile=openclaw  # 先点击获得焦点
browser act kind=type ref=评论框ref text="你的评论内容" slowly=true profile=openclaw

Step 4: 发送评论

输入完成后,按 Enter 键发送:

browser act kind=press ref=评论框ref key=Enter profile=openclaw

或者等待 Draft.js 状态同步后,发送按钮会自动启用。

获取视频 ID 的方法

如果从搜索结果页无法直接拿到视频 ID,点击视频后 URL 会变成: https://www.douyin.com/search/xxx?modal_id=7615631792858565903

提取 modal_id 就是视频 ID,然后可以直接访问: https://www.douyin.com/video/7615631792858565903

评论质量建议

  • 评论应与视频内容相关,15-40 字
  • 避免空泛("好看"、"不错")
  • 示例:「分析到位,终于有人把 OpenClaw 讲明白了!」
Usage Guidance
This skill does what it says (search Douyin and post comments) but contains two red flags: it expects to use an already-authenticated browser profile (so actions will be performed by your logged-in account) and it instructs the agent to run system commands (pkill / restart gateway) automatically if a timeout occurs. Before installing, consider: (1) only use with an expendable/test account or ensure you trust the agent and environment; (2) require the skill to ask for explicit user confirmation before posting any comment or before restarting system processes; (3) remove or modify the automatic 'pkill' restart step — system process control should not be done silently; (4) ask the author for provenance/homepage and for code review of any system commands. Because the owner and source are unknown and the skill grants implicit system-level actions without safeguards, proceed cautiously or mark as untrusted until those issues are addressed.
Capability Analysis
Type: OpenClaw Skill Name: douyin-comment Version: 1.0.0 The skill includes instructions in SKILL.md for the agent to execute shell commands (`pkill -f "node.*openclaw.*gateway"`) to restart the system gateway without user intervention. While this is framed as a fix for timeout errors, the use of unprompted process manipulation and shell execution within a browser-focused skill is a high-privilege behavior that could be abused.
Capability Assessment
Purpose & Capability
The name/description match the instructions: the SKILL.md describes searching Douyin and posting comments via a hosted browser profile (profile=openclaw). No unrelated APIs or credentials are requested. However, the skill assumes access to an authenticated browser profile (openclaw) and to system commands to restart the gateway — capabilities that are broader than 'post a comment' and should be explicitly declared.
Instruction Scope
Instructions include normal browser automation steps (navigate, evaluate, snapshot, act) which are consistent with posting comments. Major concerns: (1) an automated recovery procedure that runs system commands to pkill and restart the OpenClaw gateway without asking the user; (2) no user confirmation or rate-limiting for posting comments (could be used to spam); (3) guidance to operate on an already-authenticated profile (this implies use of the user's account but the skill provides no safeguards or explicit user consent step).
Install Mechanism
Instruction-only skill with no install spec or external downloads; nothing is written to disk by the skill itself. This minimizes installation risk.
Credentials
No environment variables or credentials are declared, which is reasonable, but the SKILL.md implicitly requires access to a logged-in browser profile and the ability to run system-level commands (pkill/openclaw gateway). Those privileges are not declared and are disproportionate for a commenter: restarting system processes and killing node processes should be justified and gated.
Persistence & Privilege
The skill is not always:true and is user-invocable, which is good. However, the instruction to auto-restart the gateway modifies system state and grants the agent implicit authority to manage platform processes; that increases blast radius if the agent runs autonomously and should be restricted or require explicit user approval.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install douyin-comment
  3. After installation, invoke the skill by name or use /douyin-comment
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the douyin-comment skill. - Enables automated search for specified keywords and posting of comments on popular Douyin videos. - Streamlined flow: completes search, video selection, commenting, and submission in 3–4 browser steps. - Incorporates robust error handling, including auto-restart of browser gateway on timeout. - Designed for efficiency and stability, supporting high-quality, context-relevant commenting.
Metadata
Slug douyin-comment
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Douyin Comment Bot?

在抖音(douyin.com)上搜索指定关键词的热门视频并发布评论。当用户说「抖音评论」「在抖音上搜 XX 发评论」「抖音互动」「执行:抖音 XX 热门 N 条评论」等涉及抖音搜索+评论的任务时触发本 skill。 It is an AI Agent Skill for Claude Code / OpenClaw, with 171 downloads so far.

How do I install Douyin Comment Bot?

Run "/install douyin-comment" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Douyin Comment Bot free?

Yes, Douyin Comment Bot is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Douyin Comment Bot support?

Douyin Comment Bot is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Douyin Comment Bot?

It is built and maintained by mars82311111 (@mars82311111); the current version is v1.0.0.

💬 Comments