/ego-skills:douyin-videofrom ego-skills
Publishes a local video file to the Douyin creator center (creator.douyin.com) via Ego Lite browser automation. Handles login checks, title (max 30 chars), description with hashtags, and detects publish success.
Ships in ego-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
用 Ego Lite 会话把本地视频发到 抖音创作者中心。终点是跳到内容管理(content/manage)或页面出现**「发布成功」**。
Publish a local video file to the Douyin creator center. Success is a redirect to content management or the text 发布成功. This skill does not download video and does not call yt-dlp.
搬运他人内容前,确认调用方拥有相应权利。平台会打击未授权搬运。
先装 Ego Lite,保证 ego-browser 在 PATH。缺失则 soft-fail / 告知用户去装,不要硬调浏览器。
Install Ego Lite and put ego-browser on PATH. If either is missing, soft-fail and tell the user. Do not hard-require the browser.
在 Ego 里已经登录抖音时效果更好。每次发布前把这句话告诉用户。
Being logged into Douyin inside Ego works better. Say that to the user before every publish.
Agent 在上传之前必须跑:
node scripts/check-login.mjs
# 需要把窗口留给人扫码时:
node scripts/check-login.mjs --keep
| 退出码 | 含义 | Agent 做什么 |
|---|---|---|
0 | 已登录 | 把 login_tip 告诉用户,继续发布 |
2 | 未登录 / 无 ego-browser | 展示 how_to_login / how_to_login_zh,停。请人在 Ego 扫码后再跑 check-login |
1 | 其它错误 | 报告 JSON error,不要假装已发布 |
详见 references/login.md。不要另做 cookie-healthcheck 技能。
默认 finish({ keep: [] })。--keep 才把登录页留着并 handOff()。
调用方提供本地文件和文案。见 references/inputs.md。本技能不绑定任何产品系列、播客或业务目录,也不下载视频。
最少需要:本机 video 路径、title(独立输入框,最多 30 个 Unicode 码位)、desc(话题写在简介里)。
默认设置即合理:公开、允许保存、立即发布。不要额外去改这些开关。
ego-browser nodejs 不继承 shell 环境变量,也不转发 shell argv。publish.sh 先把 JSON 写到 /tmp/douyin-video-publish.json,再交给 ego。
# 仓库根目录
node skills/douyin-video/scripts/check-login.mjs
node skills/douyin-video/scripts/check-login.mjs --keep
bash skills/douyin-video/scripts/publish.sh /absolute/path/to/video.mp4 "标题" "简介 #话题"
# 登录 handOff 或位置权限弹窗中断后,第 4 个参数传 spaceId。第 5 个参数 1 才保留浏览器页。
bash skills/douyin-video/scripts/publish.sh /absolute/path/to/video.mp4 "标题" "简介" 6
bash skills/douyin-video/scripts/publish.sh /absolute/path/to/video.mp4 "标题" "简介" 6 1
已安装的技能目录里用相对路径:node scripts/check-login.mjs、bash scripts/publish.sh …。
| 退出码 | 含义 |
|---|---|
0 | 成功。stdout 含 {"ok":true,"manageUrl":"https://creator.douyin.com/creator-micro/content/manage",...} |
1 | 参数或流程错误。位置权限打断时 JSON 带 resume: true 和 spaceId |
2 | 需要登录。发布脚本会 handOff() 并把 space 留着,方便扫码后带 spaceId 续跑 |
创作者表单没有 wujie。Agent 不要另写一套填表脚本,除非脚本报了 flow error 并留下 spaceId。
/content/post/video(带 spaceId 续跑),跳过上传。https://creator.douyin.com/creator-micro/content/upload。handOff()。文档标题里的产品名不算已登录。waitForFileChooser,再点去空白后文本恰好是「上传视频」的按钮(文本可能被拆成「上传」「视频」)。/content/post/video,并且正文出现「作品描述」或「添加作品简介」。execCommand('insertText') 写简介(contenteditable,占位「添加作品简介」),回读必须一致。<button>,其自身文本恰好是「发布」(不是「立即发布 / 定时发布 / 同时发布」),scrollIntoView 后坐标点击。content/manage,或正文出现「发布成功」。成功时默认 finish({ keep: [] })。其它流程错误也会关掉 space。登录墙和位置权限打断不关,以便用同一个 spaceId 续跑。第 5 个参数 1 才在成功后保留页面。
首次点击上传时,抖音可能申请地理位置。ego 会以 user-control 错误停掉这次调用。让用户在浏览器里处理(建议拒绝),然后用打印的 spaceId 重跑。点击通常已经生效,脚本看到发布表单就跳过重复上传。
评论管理还没有脚本。需要发评论时走人工,或先探测页面再操作。不要在本技能里发明评论步骤。说明见 references/pitfalls.md。
完整清单在 references/pitfalls.md。发布前先 login-check;exit 2 必须停。
publish.js 报错后,JSON 里的 spaceId 可以回到原 space。不要为了排查再开一个 space。
ego-browser nodejs <<'EOF'
const task = await taskSpace(4);
const page = task.page("p1");
console.log({ url: await page.url() });
console.log(await page.snapshot());
EOF
把 4 换成实际 spaceId。看完执行 finish({ keep: [] })。
npm test
agents/openai.yaml (opens in a new tab)references/inputs.md (opens in a new tab)references/login.md (opens in a new tab)references/pitfalls.md (opens in a new tab)scripts/check-login.mjs (opens in a new tab)scripts/lib/config-file.mjs (opens in a new tab)scripts/lib/douyin-dom.mjs (opens in a new tab)scripts/lib/ego-deps.mjs (opens in a new tab)scripts/lib/launch-check.mjs (opens in a new tab)scripts/lib/publish-flow.mjs (opens in a new tab)scripts/lib/pure.mjs (opens in a new tab)scripts/lib/run-check.mjs (opens in a new tab)scripts/lib/run-ego.mjs (opens in a new tab)scripts/publish.js (opens in a new tab)scripts/publish.sh (opens in a new tab)scripts/run-ego-module.mjs (opens in a new tab)scripts/test/cli.test.mjs (opens in a new tab)scripts/test/config-file.test.mjs (opens in a new tab)scripts/test/dom-fixture.mjs (opens in a new tab)scripts/test/douyin-dom.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub terryso/ego-skills --plugin ego-skills14 skills in this plugin
/bilibili-videoPublish a local video to the Bilibili creator platform (member.bilibili.com) with Ego Lite via ego-browser. Login-check first. Bilibili wants TWO covers uploaded separately: --cover-4x3 (首页推荐) and --cover-16x9 (个人空间). Nothing is submitted without --yes: that run only prints a local plan and exits 3. --type selects a partition from the human-type list and reads it back; a missing name stops before 立即投稿. Success is 投稿成功 / 审核中, with a BV URL or identity unconfirmed. Bilibili has no private visibility on web upload: approved submissions go public. Use when the user asks to post to B站, 哔哩哔哩, B站投稿, or publish a video to bilibili./chatgpt-image-genExpand a rough image idea with the six-axis domain engine from codex-imagegen, then create one image on the free ChatGPT website inside Ego Lite. Login-check first. Soft-fail with exit 2 when ego-browser is missing, chatgpt.com is logged out, or login cannot be proven. enrich and generate without --yes are offline. --yes sends one prompt and saves the image to --out. Flowcharts and timelines are SVG, not images. Does not call codex exec and does not use an API key. Use when the user asks to generate an image, enrich a prompt, or use ChatGPT Images without a Codex subscription./instagram-saved-downloadDownload the user's own Instagram Saved posts (images, and MP4 when asked) with Ego Lite cookies via ego-browser. Soft-fails if Instagram is logged out and tells the user that signing in is what makes Saved readable. Personal archive only. Each run checks login itself.Other plugins' skills for the same job