参考小红书发布技能(xiaohongshu-skills)的结构,为快手、B 站、抖音三个平台提供视频发布自动化能力。
目标平台:
关键词格式:
#,后加空格#美好的 #欢快 #一天的封面上传流程:
作品描述框:
标题 #关键词 1 #关键词 2 #关键词 3 #关键词 4所有发布操作只能通过浏览器自动化脚本完成:
python scripts/cli.py <子命令> 控制 Chrome 浏览器bash
# 打开对应平台,手动检查登录状态
python scripts/cli.py --platform kuaishou check-login
python scripts/cli.py --platform bilibili check-login
python scripts/cli.py --platform douyin check-login
--headless 模式(未登录自动降级到有窗口模式)text
标题:明天更好
视频数据路径:/Users/xiaohei/.openclaw/workspace/skills/app_publish/test_data/test_video.mp4
封面:/Users/xiaohei/.openclaw/workspace/skills/app_publish/test_data/image.png
关键词:美好的,欢快,一天的
字段说明:
bash
cd /Users/xiaohei/.openclaw/workspace/skills/app_publish/scripts
# 完整发布(填写 + 点击发布)
python cli.py publish-kuaishou --config ../test_data/描述.txt
# 只填写表单,不发布(用于预览确认)
python cli.py publish-kuaishou --config ../test_data/描述.txt --no-publish
# 指定等待超时时间(秒)
python cli.py publish-kuaishou --config ../test_data/描述.txt --wait-timeout 600
bash
# 完整发布
python cli.py publish-bilibili --config ../test_data/描述.txt
# 分步发布
python cli.py publish-bilibili --config ../test_data/描述.txt --no-publish
# 在浏览器中确认预览后,手动点击发布
bash
# 完整发布
python cli.py publish-douyin --config ../test_data/描述.txt
# 指定 Chrome 端口
python cli.py publish-douyin --config ../test_data/描述.txt --port 9222
bash
# 依次发布到快手、B 站、抖音
python cli.py publish-all --config ../test_data/描述.txt
# 带超时设置
python cli.py publish-all --config ../test_data/描述.txt --wait-timeout 300
注意: publish-all 会在同一浏览器会话中依次执行三个平台的发布,总耗时可能较长(每个平台约 1-3 分钟)。
参数说明默认值--config pathTXT 配置文件路径(必须)---wait-timeout seconds上传等待超时时间300--no-publish只填写表单,不点击发布false--port PORTChrome CDP 端口9222--host HOSTChrome CDP 主机127.0.0.1--headless无头模式false--user-data-dir pathChrome 用户数据目录~/.kbs/chrome-profile
json
{
"success": true,
"platform": "bilibili",
"title": "明天更好",
"video_path": "/path/to/video.mp4",
"cover_path": "/path/to/cover.png",
"keywords": ["美好的", "欢快", "一天的"],
"status": "发布完成",
"message": "视频上传成功,表单已填写"
}
json
{
"success": false,
"platform": "kuaishou",
"error": "上传超时,请检查网络连接或视频文件大小",
"status": "上传失败"
}
错误类型可能原因解决方案上传超时视频文件过大、网络慢增加 --wait-timeout 参数登录失效Cookie 过期重新登录对应平台选择器失效页面结构变更更新 selectors_*.py 中的 CSS 选择器文件不存在路径错误检查 TXT 配置中的文件路径Chrome 未启动调试端口未开放确保 Chrome 以 --remote-debugging-port=9222 启动
text
app_publish/
├── scripts/
│ ├── cli.py # CLI 入口(6.8KB)
│ ├── chrome_launcher.py # Chrome 启动器(9KB)
│ ├── requirements.txt # Python 依赖
│ └── kbs/ # 核心模块
│ ├── __init__.py
│ ├── cdp.py # CDP 封装(22KB)
│ ├── types.py # 数据类型 + 配置解析(4KB)
│ ├── selectors_ks.py # 快手选择器(1.5KB)
│ ├── selectors_bili.py # B 站选择器(1.1KB)
│ ├── selectors_dy.py # 抖音选择器(859B)
│ ├── publish_kuaishou.py # 快手发布逻辑(4.5KB)
│ ├── publish_bilibili.py # B 站发布逻辑(4KB)
│ └── publish_douyin.py # 抖音发布逻辑(4.5KB)
├── test_data/
│ ├── test_video.mp4 # 测试视频
│ ├── image.png # 测试封面
│ └── 描述.txt # 测试配置
├── 任务.md # 任务需求文档
└── SKILL.md # 技能说明文档(本文件)
✅ 已完成:
⚠️ 待完善:
--wait-timeout 600 或更长--port 9222 可复用已登录的 Chrome 会话bash
cd /Users/xiaohei/.openclaw/workspace/skills/app_publish/scripts
pip install -r requirements.txt
# 或手动安装
pip install requests websockets
开发时间: 2026-04-02
参考技能: xiaohongshu-skills/xhs-publish
开发工具: Cursor CLI Agent