通过 camoufox-cli 持久化 session wechat-channel 发布视频到微信视频号,支持视频上传、标题描述填写、即时发布。
64
77%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./crews/main/skills/wechat-channels-publish/SKILL.md通过 camoufox-cli 持久化 session wechat-channel(有且只有一个,fail-first 队列:同 session 已有命令在跑时新命令直接 fail)在微信视频号创作者中心发布视频。视频号创作者中心使用 wujie 微前端,所有表单元素在 <wujie-app>::shadow-root 内——camoufox-cli 的 snapshot 默认穿透 shadow DOM 拿 ref,后续 click / type / upload 按 ref 操作即可,无需 CDP hack。
主力后端 =
target=camoufox。下方命令 / 示例只针对target=camoufox。target=host/target=node:只按本 skill 的「流程 + 提示事项」走——全部无头 / 频率限制 / 错误处理约定是后端无关的,照本 skill 执行。不要照搬camoufox-cli ...命令,用你当前后端自带的浏览器工具语义调用即可。
wechat-channel 已登录(登录态存 session profile 里)。本 skill 与 login-manager 完全无关——自管探活 + 登录,不导出 cookie/UA 落中央存储。登录和发布全部走无头模式(camoufox-cli 默认即 headless)。camoufox-cli --session wechat-channel --persistent --json open "https://channels.weixin.qq.com/platform/home"<img> 注入完成(轮询 eval 检查 document.querySelectorAll('img') 有 src 以 data:image 开头的元素,最多等 10s)camoufox-cli --session wechat-channel --persistent --json screenshot /tmp/qr-wechat-channel.png 截 QR PNGcamoufox-cli --session wechat-channel --json url),确认已跳走登录页(URL 含 platform/home 且不含 login)即登录就位--session wechat-channel --persistent 重起无头即恢复,用完再 close。不导出 cookie/UA——登录态只在 session profile 里闭环,不落
~/.openclaw/logins/。本 skill 不调用cookies export/identity export。
camoufox-cli --session wechat-channel --persistent --json open "https://channels.weixin.qq.com/platform/post/create"等待 5 秒(wujie 需要额外时间初始化 shadow DOM)。
snapshot 看页面 URL 是否含 login 或出现登录二维码——命中走前置条件的无头截图扫码登录流。
1. snapshot 拿到上传触发按钮 ref(shadow DOM 内的 span.add-icon 或 div.upload-content)
2. camoufox-cli --session wechat-channel --persistent --json click <上传触发-ref>
3. snapshot 拿到弹出的 <input type="file"> ref
4. camoufox-cli --session wechat-channel --persistent --json upload <input-ref> <video.mp4>
- camoufox-cli upload 命令底层走 Playwright setInputFiles,穿透 shadow DOM,无需 CDP setFileInput / base64 hack支持的视频格式:.mp4、.mov、.avi、.webm
每 3 秒 snapshot 检查一次页面状态:
[class*="uploading"] 或 [class*="progress"][class*="transcoding"]<video> 预览或 [class*="preview-video"] 或文本"上传成功"/"转码完成"[class*="upload-fail"] 或文本"上传失败"1. snapshot 拿到标题输入框 ref:input[placeholder*="短标题"](在 shadow DOM 内)
2. camoufox-cli --session wechat-channel --persistent --json type <标题-ref> "短标题"
- 建议 6-16 字,最长约 30 字1. snapshot 拿到描述输入框 ref:div[contenteditable][data-placeholder="添加描述"]
2. camoufox-cli --session wechat-channel --persistent --json click <描述-ref> 聚焦
3. camoufox-cli --session wechat-channel --persistent --json type <描述-ref> "描述内容 #话题1 #话题2"
- 话题标签直接写在描述中
- 最长约 300 字视频号发布不必勾选"原创声明",发布后用户会在手机端补充。
1. snapshot 拿到"发表"按钮 ref(文本为"发表"或"发布",在 shadow DOM 内)
2. 确认按钮不是 disabled 状态(snapshot 看)
3. camoufox-cli --session wechat-channel --persistent --json click <发表-ref>
4. 若弹出"原创声明弹窗",snapshot 拿"直接发表"按钮 ref → click等待 4 秒后 snapshot 检查:
https://channels.weixin.qq.com/platform/post/list发布成功后,在视频号管理后台的视频列表页获取视频公开链接:
1. snapshot 找到刚发布的视频(列表第一条,或按标题匹配)ref
2. snapshot 找该视频的"分享"按钮 ref → click
3. snapshot 在弹出的分享面板中找"复制视频链接"按钮 ref → click
4. snapshot eval 从剪贴板或弹窗读取链接:
camoufox-cli --session wechat-channel --persistent --json eval "navigator.clipboard.readText()"
链接格式通常为 https://weixin.qq.com/sph/xxxxxx(sph 即视频号拼音缩写)注意:如果刚发布的视频还在审核中,"分享"按钮可能不可用。此时可先完成发布记录(publish_url 留空),待审核通过后再补充链接。
在 Step 7 中 snapshot 找"存草稿"按钮 ref → click(而非"发表")。
如果需要人工检查表单后再发布:
wechat-channel——登录态 + 指纹冻结在磁盘 profile,不留进程占内存;下次发布 --session wechat-channel --persistent 重起无头即恢复。只在 session 卡死时 camoufox-cli --session wechat-channel --json close teardown。session wechat-channel 正忙,请等待当前操作完成后再试)——读到这条文本就等当前操作完成再重试,不要盲试。本 skill 与 wx-channel-engagement 共用同一个 wechat-channel 持久化 session,靠 session 名字符串约定共享同一 profile 目录与登录态——任一技能登录后另一个不需重登,反之亦然。单一 session、单一 IP、单一 profile,避免多 session 多 IP 的风控风险。
session wechat-channel 正忙 → exit 3,调用方(agent)等待当前操作完成后再试,不自动排队、不自动 close 正在跑的 session。wechat-channel session profile 里就位即可。失效时走本 skill 前置条件的无头截图扫码重登流,或由 wx-channel-engagement 自己的重登流触发。wechat-channel session 的探活 + 登录 + 重登。wx-channel-engagement 同理自管,不调 login-manager。参考:
twitter-post+twitter-interact的 session 共享模式(靠 session 名字符串约定共享同一 profile 目录与登录态)。
camoufox-cli snapshot 默认穿透 shadow DOM 拿 ref,后续 click / type / upload 按 ref 操作即可。fallback 才需要 eval 里手写 document.querySelector('wujie-app').shadowRoot.querySelector(selector)| 情况 | 处理 |
|---|---|
| 未登录 | 走前置条件的无头截图扫码登录流,重试一次 |
| 上传失败 | 检查视频格式(mp4/mov/avi/webm),重试一次 |
| 转码超时 | 增加超时时间,或告知用户稍后在创作者中心检查 |
| 发表按钮 disabled | 检查必填字段是否已填写(视频是否上传完成) |
| shadow DOM 元素找不到 | 等待更长时间让 wujie 初始化,或刷新页面 |
| session 正忙(fail-first) | 等当前操作完成再重试,不要盲试 |
本技能只管发布到视频号后台,不调 record.sh——入库走 main crew 工作流(AGENTS.md 的「发布后数据记录流程」段)。但调用方需注意:
record.sh --platform wx_channel --title必须传 Step 6 填的完整描述文案(含 hashtag,最长约 300 字),不要传 Step 5 的短标题。
原因:视频号作品没有「标题」概念,作品管理页展示与 wx-channel-engagement 抓取匹配用的都是描述文案。pub_wx_channel.title 列存的就是完整 desc,wx-channel-engagement fetch 按它匹配后台才能成功。传短标题会导致抓取匹配全部失败。
fdc03d6
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.