- Inicio
- Plugins
- Herramientas y funciones
- dsh-douyin-subagent
dsh-douyin-subagent
wu079/dsh-douyin-subagent
Runs a Douyin subagent that browses videos and reads comments in valley hours and reports back, with dy_* tools for publishing and replying (comments sent from the already-logged-in page with its own request signature, no IM ticket), a daily quota timer, and a settings panel under Settings → Douyin: master switch, auto mode, valley windows, rounds per day and report depth. Windows-oriented; needs the separate douyin-mcp binary (yunsur/douyin-mcp releases, path set via dy_config mcpExe) and an Edge/Chromium login; replying needs a logged-in browser on a CDP port; publishing needs extra credentials most accounts lack.
Instalar
dsh plugin --profile web add github:wu079/dsh-douyin-subagentREADME
dsh-douyin-subagent
A "scroll Douyin" plugin for DSH — modeled on dsh-bili-subagent. At valley hours it sends a subagent to browse Douyin: search videos, read details, go through the comments, pick what is worth watching, and report back. The hard part (Douyin APIs, signing, login state) is provided by yunsur/douyin-mcp — 133 tools over plain HTTP.
English | 中文
What you get
- 11 tools:
dy_status/dy_config/dy_login/dy_search/dy_video/dy_comments/dy_comment/dy_publish/dy_scan/dy_tools/dy_mcp - Valley-time timer: 13:00–15:00 and 19:00–10:00 (next day), weekends count as valley all day.
At the appointed time it hands a trigger to the target session; the agent then runs
dy_scanitself.perDayrounds per day, at leastgapMinminutes apart. - Charter
prompts/duty.md(overridable at$DSH_HOME/douyin-duty/duty.md): verify login, search 2–3 keyword variants, read details and comments, pick at most N, "better nothing than junk", never guess. - Reports at
$DSH_HOME/douyin-duty/out/<date>.md.
Requirements
| piece | what |
|---|---|
| DSH | a profile that can install plugins (this is a bundle plugin, dsh.bundle declared) |
douyin-mcp-windows-amd64.exe | prebuilt binary from yunsur/douyin-mcp releases. The plugin spawns it on :18080; you point mcpExe at it |
| a Chromium-based browser (Edge/Chrome) | only for login + publishing; the plugin drives it over CDP on port 9222 with a dedicated --user-data-dir |
| a Douyin account | log in once through the browser, export cookies, done |
Install
dsh plugin --profile <your-profile> add github:WU079/dsh-douyin-subagent
Then restart DSH (or reload the profile) — the dy_* tools show up.
First run
-
Put
douyin-mcp-windows-amd64.exeanywhere and tell the plugin where:dy_config { "patch": { "mcpExe": "D:/tools/douyin-mcp-windows-amd64.exe" } }(or set
DOUYIN_MCP_EXEin the host environment) -
Log in:
dy_login { "action": "open" } # opens a controlled Edge window at douyin.com # scan the official QR code with the Douyin app dy_login { "action": "save" } # exports cookies from the browser over CDP dy_status # should now show your nicknameBecause the browser is a dedicated profile, it keeps its login: next time you can just
dy_login { "action": "save" }to refresh the cookie file. -
Use it:
dy_scan { "direction": "本地语音克隆 踩坑", "n": 1 } dy_search { "keyword": "..." } dy_video { "aweme_id": "..." } dy_comments { "aweme_id": "...", "count": 30 }
Config
dy_config reads/writes $DSH_HOME/douyin-duty/config.json.
| key | default | meaning |
|---|---|---|
enabled | true | plugin on/off |
autoMode | valley | manual / valley / always |
noon / night | true | which windows are active |
perDay / gapMin | 2 / 180 | auto rounds per day / minutes between rounds |
direction | "" | what to look for |
keywords | [] | fallback directions |
perScan | 1 | how many items each round |
mcpExe | "" | path to douyin-mcp-windows-amd64.exe |
mcpPort | 18080 | MCP HTTP port |
mcpToken | generated | bearer token for the local MCP server; random on first run if empty |
browserPort | 9222 | CDP port of the controlled browser |
browserProfile | <home>/browser | --user-data-dir of that browser |
cookieFile | <home>/cookies.txt | where the exported cookie lives |
targetSession | "" | session to deliver the trigger to; empty = most recent |
triggerPrompt | built-in | text handed to the session |
reportLevel | full | full / brief / off |
Notes & boundaries
- The MCP server is local-only. The plugin spawns it with a random per-install bearer token bound to
127.0.0.1. - Publishing through the MCP tools needs extra TICKET/TS_SIGN/PRIVATE_KEY material that most accounts cannot
mint; in practice publishing goes through the creator web UI.
vendor/douyin-tools/has the CDP helpers for that. check_login_statuslies. Judge login state byget_my_profilereturningstatus_code === 0(dy_statusdoes this for you).- Cookies expire; refresh with
dy_login { action: "save" }while the controlled browser is still logged in. - Young accounts are rate-limited. Comment/publish in small amounts and spaced out.
- Nothing here is affiliated with Douyin/ByteDance. Use it for personal browsing; respect their terms and other people's privacy. Read other people's comments, don't mass-harvest them.
License
MIT — see LICENSE.
中文
给 DSH 的「刷抖音」插件,照着 dsh-bili-subagent 做的。 谷时到点派子代理去抖音:搜视频、看详情、翻评论、挑出值得看的,回来汇报。 能力来自 yunsur/douyin-mcp(133 个工具,纯 HTTP)。
有什么
- 11 个工具:
dy_status/dy_config/dy_login/dy_search/dy_video/dy_comments/dy_comment/dy_publish/dy_scan/dy_tools/dy_mcp - 谷时定时器:中午 13:00–15:00、夜里 19:00–次日 10:00,周末整天算谷时;到点往目标会话递一句话,
agent 自己用
dy_scan刷。每天perDay轮,两轮至少隔gapMin分钟。 - 值班章程:
prompts/duty.md(家里$DSH_HOME/douyin-duty/duty.md优先,可自己改)。 - 报告:
$DSH_HOME/douyin-duty/out/<日期>.md。
依赖
| 件 | 说明 |
|---|---|
| DSH | 能装插件(本插件声明了 dsh.bundle) |
douyin-mcp-windows-amd64.exe | yunsur/douyin-mcp releases 的预编译版;插件会在 :18080 拉起它,路径用 mcpExe 配 |
| Chromium 系浏览器(Edge/Chrome) | 只用来登录和发布;插件用独立的 --user-data-dir 通过 CDP 驱动它 |
| 抖音账号 | 在受控浏览器里扫一次码,导出 cookie 即可 |
安装
dsh plugin --profile <你的 profile> add github:WU079/dsh-douyin-subagent
重启 DSH,工具里就会出现 dy_*。
第一次用
-
把
douyin-mcp-windows-amd64.exe放好,告诉插件位置:dy_config { "patch": { "mcpExe": "D:/tools/douyin-mcp-windows-amd64.exe" } }(或在宿主环境变量里设
DOUYIN_MCP_EXE) -
登录:
dy_login { "action": "open" } # 起一个受控 Edge 打开 douyin.com # 用手机抖音扫官方二维码登录 dy_login { "action": "save" } # 通过 CDP 把 cookie 导出来 dy_status # 这时应该能看到昵称 -
用起来:
dy_scan { "direction": "本地语音克隆 踩坑", "n": 1 } dy_search { "keyword": "..." } dy_video { "aweme_id": "..." } dy_comments { "aweme_id": "...", "count": 30 }
配置
dy_config 读写 $DSH_HOME/douyin-duty/config.json,字段见上方英文表格(同一张表)。
注意与边界
- MCP 只监听本机:插件启动它时用每次安装随机生成的 Bearer token,绑在
127.0.0.1。 - 发布:MCP 的发布工具需要 TICKET/TS_SIGN/PRIVATE_KEY 这类材料,多数账号拿不到;实际发布走创作者中心网页,
vendor/douyin-tools/里有配套的 CDP 脚本。 check_login_status会误报:判断登录看get_my_profile的status_code === 0(dy_status已经替你处理)。- cookie 会过期:受控浏览器还登着的时候,
dy_login { action: "save" }重新导一次。 - 新号风控严:评论、发布小量、隔开。
- 与抖音/字节跳动无关;个人使用,遵守对方条款、尊重别人隐私。看评论可以,别批量抓。
许可
MIT,见 LICENSE。
设置里的控制面板(0.1.1 起)
装好之后,进 设置 → 刷抖音,可以改:
- 总开关(关掉后定时器不动,
dy_*工具和手动/刷还能用) - 自动模式:只手动 / 只在谷时 / 全天;中午、晚上两个谷时开关
- 每天最多刷几轮、两轮之间至少隔多少分钟、每轮挑几条
- 方向、关键词候选、报告里对你的称呼、报告详细程度
- 底部一行状态:今天第几轮、MCP 在不在线、登录态、上次刷的时间、最近一份报告
面板走插件自己挂的 /api/douyin-duty/* 路由读写 $DSH_HOME/douyin-duty/config.json,和 dy_config 工具改的是同一份。浏览器半端 client.js 的约定抄自 dsh-bili-subagent(window.__ModuleLoader__.load + slots.inject('settings.section'))。
评论/回复:页面签名直发(0.2.0 起)
MCP 的 post_video_comment 要 ticket/ts_sign(IM 会话签名),纯 cookie 登录拿不到,所以 dy_comment 会先走一条更简单的路:
- 你有一个已登录 douyin.com 的 Chromium/Edge,开着远程调试端口(
cdpPort,默认9333):
(用着刷视频的窗口也行,只要带"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9333 ^ --user-data-dir=F:\douyin-browser https://www.douyin.com/--remote-debugging-port) - 插件连上 CDP,在页面上下文里调
window.byted_acrawler.frontierSign生成X-Bogus,再用页面自己的fetch发POST /aweme/v1/web/comment/publish。cookie、指纹、签名都是真的,等同网页自己发评论。 - 实测:连续 5 条回复(含楼中楼
reply_id)全部 HTTP 200、返回cid,没有触发滑块/短信验证;dy_comment { "aweme_id": "...", "content": "...", "reply_id": "..." }的返回里via会是page。 - 页面不在(CDP 连不上)时自动退回 MCP——那条路通常仍会失败,但不会让工具直接崩。
只用最小参数(device_platform / aid / aweme_id / reply_id + X-Bogus)即可,不需要 msToken、verifyFp 那些模板参数;
真遇到风控(返回非 200 或需要验证),工具会把响应片段抛出来,这会儿应该停下来人工处理,别硬重试。
Plugins relacionados
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
weknora
tencent/weknora
BrowserSkill (dsh-plugin-browserskill)
tencent/browserskill