/ego-skills:bilibili-videofrom ego-skills
Publishes a local video file to Bilibili creator platform via Ego Lite browser automation. Handles dual cover uploads (4:3 and 16:9), partition selection, and login verification. Use when user asks to post to B站 or upload a video to bilibili.
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 会话把本地视频投到 B 站创作中心。终点是**「投稿成功」且稿件进入审核**。
Publish a local video file to the Bilibili creator platform. The endpoint is 投稿成功 with the work under review. No download step.
先装 Ego Lite,保证 ego-browser 在 PATH。非交互 shell 找不到时,再试 ~/.local/bin/ego-browser。仍然缺失则 soft-fail(退出码 2),不要改用 Playwright、Puppeteer 或云端浏览器。
Install Ego Lite and put ego-browser on PATH. If missing, soft-fail with exit 2. Do not switch stacks.
node skills/bilibili-video/scripts/check-login.mjs
# 需要把窗口留给人扫码时:
node skills/bilibili-video/scripts/check-login.mjs --keep
| 退出码 | 含义 | Agent 做什么 |
|---|---|---|
0 | 已登录 | 继续 |
2 | 未登录 / 无 ego-browser | 展示 how_to_login,停,请人在 Ego 扫码后重跑 |
1 | 其它错误 | 报告 JSON error,不要假装已投稿 |
ego-browser nodejs 不继承 shell 环境变量,也不转发 argv,所以由 publish.mjs 把 JSON 写到 /tmp 再交给 ego。参数全部走 flag(key=value 也支持):
# 仓库根目录。没有 --yes 且没有 --stop-before-submit:只做本地校验并打印计划,exit 3,不打开浏览器
# 验收入口:真实上传并校验,但在「立即投稿」之前退出。和 --yes 同时出现也不会投稿
node skills/bilibili-video/scripts/publish.mjs \
--video /absolute/path/to/video.mp4 \
--title "标题" \
--cover-4x3 /absolute/path/to/cover-4x3.png \
--cover-16x9 /absolute/path/to/cover-16x9.png \
--type "科技数码" \
--stop-before-submit
node skills/bilibili-video/scripts/publish.mjs \
--video /absolute/path/to/video.mp4 \
--title "标题(≤80字)" \
--desc "简介(≤2000字),话题写在正文里"
# 真实投稿:封面两张分开传(4:3 首页推荐 + 16:9 个人空间)
node skills/bilibili-video/scripts/publish.mjs \
--video /absolute/path/to/video.mp4 \
--title "标题" \
--desc "简介" \
--cover-4x3 /absolute/path/to/cover-4x3.png \
--cover-16x9 /absolute/path/to/cover-16x9.png \
--tags "标签1,标签2" \
--declare ai \
--yes
# 中断后用 spaceId 续跑,--keep 保留页面
node skills/bilibili-video/scripts/publish.mjs --video ... --title ... --yes --space-id 12
| 退出码 | 含义 |
|---|---|
0 | 投稿成功,stdout 有 {"ok":true,"status":"审核中","bvid","url","identity"};读不到稿件号时 identity 为 unconfirmed,url 为 null |
1 | 参数或流程错误(JSON 在 stderr) |
2 | 需要登录(脚本内遇登录墙会 handOff()) |
0 | --stop-before-submit:表单已填完并回读,submitted 为 false,没有点「立即投稿」。和 --yes 同时使用也停 |
3 | 没有 --yes 也没有 --stop-before-submit 的计划模式,未上传未投稿 |
投稿表单的分区是必填。不传 --type 时,沿用表单记住的分区并在结果里回读这个名字;分区为空则 exit 1。
传了 --type 时,打开 .video-human-type 的人选列表并点对应项,再读 chip。列表里没有这个名字,或点完回读不一致,就在「立即投稿」之前退出,不会留着旧分区继续投。
--declare 对应表单的必填创作声明下拉;为空时点「立即投稿」会被表单校验拦下(下拉被弹开,投稿不发生)。取值:
| flag 值 | 表单选项 |
|---|---|
none(默认) | 内容无需标注 |
ai | 含AI生成内容 |
fiction | 含虚构演绎内容 |
marketing | 内容含营销信息 |
opinion | 个人观点,仅供参考 |
repost | 内容为转载 |
original | 内容为自制:未经作者允许,禁止转载 |
Agent 必须向用户确认内容性质:AI 生成(AI 配音/AI 生成画面等)要传 --declare ai,这是平台合规要求;转载内容传 --declare repost。不要默默用默认值绕过这个决定。
handOff()。waitForFileChooser → 交视频文件,轮询「上传完成 / 更换视频」(最长 15 分钟)。--tags 并核对 chip;简介写入 Quill 编辑器并回读校验。.sync-checkbox-wrapper 里可见勾选,连续两次未勾选后才上传。4:3 传「首页推荐」槽、16:9 传「个人空间」槽,每次选文件前再确认勾选是关的。成功回执里两槽各自带 slot、width、height 和 match。传完第二张再复核 4:3 槽仍是原来那张图,才点「完成」;表单 .cover-img 出现背景图才算落位。任何一步不确认就不投稿。url;没有就按标题轮询创作中心稿件接口(进行中/已发布),直到读到或超时,最后再只读扫稿件管理。仍然没有则 identity 为 unconfirmed。成功时默认 finish({ keep: [] });--keep 才保留页面。
完整清单在 references/pitfalls.md,选择器细节在 references/selectors.md。发布前先 login-check;exit 2 必须停。
post-video.mjs 报错后,JSON 里的 spaceId 可以回到原 space 排查,不要另开 space:
ego-browser nodejs <<'EOF'
const task = await taskSpace(12);
const page = task.page("p1");
console.log({ url: await page.url() });
EOF
把 12 换成实际 spaceId。
npm test
单元测试不访问 bilibili.com;真实投稿冒烟用一张小视频 + 两张测试封面人工触发。
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)references/selectors.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/ego-deps.mjs (opens in a new tab)scripts/lib/launch-check.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/post-video.mjs (opens in a new tab)scripts/publish.mjs (opens in a new tab)scripts/test/config-file.test.mjs (opens in a new tab)scripts/test/launch-check.test.mjs (opens in a new tab)scripts/test/pure.test.mjs (opens in a new tab)scripts/test/run-check.test.mjs (opens in a new tab)scripts/test/run-ego.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub terryso/ego-skills --plugin ego-skills14 skills in this plugin
/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./douyin-videoPublish a local video to the Douyin creator center (creator.douyin.com) with Ego Lite via ego-browser. Login-check first. Title is a separate field of at most 30 characters. Success is a redirect to content management or a publish-success message. The caller supplies a local video file. This skill does not download video. Use when the user asks to post to 抖音, 抖音发视频, 发布到抖音创作者中心, or creator.douyin.com./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./kuaishou-videoPublish a local video to the Kuaishou creator platform (cp.kuaishou.com) with Ego Lite via ego-browser. Login-check first. Success means the work shows 审核中. Optional comment from the creator comment manager. The caller supplies a local video file and a description. This skill does not download video. Use when the user asks to post to 快手, 快手发视频, 发布到快手创作者平台, or comment on a Kuaishou work from the creator backend./pinterest-downloadSearch Pinterest and save images or MP4s with the user's Ego Lite cookies. Also related pins, board feeds, and small previews the model can read. Parity with @sunkimkk/pinterest-mcp. Soft-fails if Pinterest is logged out, and always tells the user that signing in inside Ego improves results. Personal use only./teambition-egoRead and update Teambition test plans and single test cases through the Ego Lite browser session (www.teambition.com). Login-check first. Phase 2a writes are create, update title/precondition/steps, set-status, and archive (delete --yes). Use when the user mentions Teambition 测试用例, 用例库, 测试计划, testplan, or case steps. Do not use teambition_cli, an Open API token, or the task search API for this module.
Other plugins' skills for the same job