Skip to content

Releases: jefftko/PostFlow

v1.0 — PUBLISH_GUIDE + 抖音/小红书/视频号 fixes

25 May 15:55

Choose a tag to compare

PostFlow v1.0

🎉 First tagged release. Multi-platform video auto-publishing tool — write once, publish everywhere.

✨ What's in v1.0

抖音 / 小红书 / 视频号 的 web 后台在 2026 Q1–Q2 多次改版,老脚本基本跑不通。v1.0 把核心 uploader 重写到能稳定跑生产的状态。

📖 New documentation

  • docs/PUBLISH_GUIDE.md — 一文档让任何开发者 / AI agent 一读就懂:安装 → 登录拿 cookie → 抖音/小红书上传 → 定时发布 → 6 个已知坑 + 实战解法

🐛 Critical fixes

Douyin (uploader/douyin_uploader/main.py):

  • ✅ Use local Chrome (executable_path=LOCAL_CHROME_PATH)——bundled chromium triggers 风控
  • ✅ JS-click 「定时发布」radio 绕过 canvas 覆盖层
  • ✅ Multi-selector fallback for 时间输入框(class 名几周一换)
  • wait_until="domcontentloaded" + 60s timeout for goto

Xiaohongshu (uploader/xiaohongshu_uploader/main.py):

  • ✅ ★ 发布按钮是 Web Component,不是 <button>。用 xhs-publish-btn[submit-text="定时发布"][submit-disabled="false"] selector——所有 has-text 方案都失败。(踩坑 5+ 次才定位)
  • ✅ Rewrote scheduling 逻辑——Esc + 点击空白处 + 多 selector 兜底
  • ✅ Same executable_path fix as Douyin

WeChat Channels / 视频号 (uploader/tencent_uploader/main.py):

  • wait_for_selector('input[type=file]') 替代固定 sleep(3)——页面 JS 初始化慢,固定 sleep 经常漏选元素
  • ✅ Upload selectors 用 .first 防 Playwright strict-mode violation(div[class*="upload"] 匹配 7 个元素)

🧹 Repo hygiene

  • 强化 .gitignore——排除 upload_*.py 私有脚本 / cookies/ / accounts.ini 真实 cookie / account/ / *.rdb
  • 删除废弃文件:debug_xhs_upload.py / douyin_fixed_upload.py / test_douyin_ep08.py / examples/upload_video_to_xhs.py(旧版示例已被 upload_video_to_xiaohongshu.py 取代)

🚀 Quick start

git clone https://github.com/jefftko/PostFlow.git
cd PostFlow
pip install -r requirements.txt
playwright install chromium
cp conf.example.py conf.py
# edit conf.py: BASE_DIR + LOCAL_CHROME_PATH

# Login (扫码一次)
python examples/get_douyin_cookie.py
python examples/get_xiaohongshu_cookie.py

# Upload
python examples/upload_video_to_douyin.py
# or
python cli_main.py upload --platform douyin --file path/to/video.mp4 --title "..." --tags "tag1,tag2"

See docs/PUBLISH_GUIDE.md for full details.

⚠️ Notes

  • Browser automation = fragile. 如果抖音/小红书改 UI,selector 可能失效。PRs welcome.
  • Cookie 文件绝不能提交到 public fork。.gitignore 已配置好,不要绕过。

🙏 Credits

Original fork base from dreammis/social-auto-upload — see README for credit.