Communitygithub.com

omni-video-publisher

Universal open-source multi-platform video publisher Skill with zero-touch environment auto-bootstrap. Given any local video file and optional caption/copy file (Markdown, text, JSON — or auto-synthesized by learning from the account's recent published works), autonomously bootstraps chrome-devtools MCP & ffmpeg on fresh machines (Codex, Claude Code, Antigravity, Gemini CLI), adapts metadata, validates or auto-generates platform covers (3:4, 4:3, 16:9) and mobile proxies, and publishes directly through the user's already-logged-in Chrome browser via chrome-devtools MCP (--autoConnect, zero API keys) to Xiaohongshu (小红书), Bilibili (B站), Douyin (抖音), X (Twitter), and YouTube / YouTube Shorts. Use whenever the user asks to configure, upload, or cross-post a video to any subset or all of these five platforms.

omni-video-publisher 是什么?

omni-video-publisher is a Claude Code agent skill that universal open-source multi-platform video publisher Skill with zero-touch environment auto-bootstrap. Given any local video file and optional caption/copy file (Markdown, text, JSON — or auto-synthesized by learning from the account's recent published works), autonomously bootstraps chrome-devtools MCP & ffmpeg on fresh machines (Codex, Claude Code, Antigravity, Gemini CLI), adapts metadata, validates or auto-generates platform covers (3:4, 4:3, 16:9) and mobile proxies, and publishes directly through the user's already-logged-in Chrome browser via chrome-devtools MCP (--autoConnect, zero API keys) to Xiaohongshu (小红书), Bilibili (B站), Douyin (抖音), X (Twitter), and YouTube / YouTube Shorts. Use whenever the user asks to configure, upload, or cross-post a video to any subset or all of these five platforms.

兼容平台✓Claude Code✓Codex CLI✓Cursor✓Antigravity✓Gemini CLI
npx skills add https://github.com/AndyShan11/omni-video-publisher/tree/HEAD

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Omni Video Publisher (小红书 / B站 / 抖音 / X / YouTube)

A universal, brand-agnostic, zero-API-key video publishing Skill for AI coding & browser agents (OpenAI Codex, Claude Code, Antigravity, Gemini CLI, Cursor).

Provide one video + one copy file (or let the agent learn your channel's title/description style from recent posts!), and the agent automatically checks/bootstraps the local environment, prepares platform-native assets, and publishes across all 5 major video platforms using your already-logged-in Google Chrome via chrome-devtools MCP (--autoConnect):

PlatformCreator Studio URLVideo StrategyCover AspectURL Policy
小红书 (Xiaohongshu)https://creator.xiaohongshu.com/publish/publishCRF 22 _Share.mp4 (passes 高清视频, 2× faster)3:4Strip raw https://
B站 (Bilibili)https://member.bilibili.com/platform/upload/video/frameMaster .mp44:3 or 16:9Keep clean links
抖音 (Douyin)https://creator.douyin.com/creator-micro/content/uploadMaster .mp43:4 verticalStrip raw https://
X (Twitter)https://x.com/compose/postMaster / ≤512 MB MP4 (H.264/AAC)Optional video thumbKeep links (23-char t.co)
YouTube / Shortshttps://studio.youtube.comMaster .mp4 (auto-detects Shorts if ≤180s & vertical/square)16:9 (Long) / frame (Shorts)Keep full links & chapters

Reference Map (Load Only What You Need)

  • Fresh-machine setup, Codex config.toml / Claude / Antigravity / Gemini MCP config, proxy speed, or deadlock recovery: read references/mcp-setup.md.
  • Exact character caps, bitrate/duration limits, Shorts detection, cover geometry, and URL rules: read references/platform-specs.md.
  • Account history readers + live DOM selectors, JS injection helpers, cover upload modals, and submit flows for all 5 platforms: read references/dom-playbook-5platforms.md.

Non-Negotiable Safety & Reliability Rules

  1. Auto-Bootstrap Missing Prerequisites Before Failing (Stage 0):
    • On a fresh machine (especially Codex, Claude Code, Gemini CLI, or Antigravity), NEVER give up just because chrome-devtools MCP tools or ffmpeg are missing. Run scripts/bootstrap.py first to diagnose and configure the client automatically, then ask the user only for the two browser-security steps Chrome mandates (toggling chrome://inspect/#remote-debugging ON + restarting the agent session once).
  2. Always Run scripts/prepare_package.py Before Uploading:
    • Never eyeball title lengths, aspect ratios, codec compatibility, or link policies. Run the CLI adapter to inspect the video (ffprobe/ffmpeg), enforce every platform limit, optionally build missing covers (3:4, 4:3, 16:9) and a _Share.mp4 proxy, and emit a deterministic publish_plan.json.
  3. Pattern Mirroring, Style Clone & Anti-Duplicate Check:
    • Before uploading on any platform, check the currently logged-in account badge and recent uploads (new/note-manager, content/manage?tab=works, upload-manager/article, x.com/<handle>, studio.youtube.com Content tab) so you never accidentally publish to the wrong account or double-post an identical title — and if the user asked to match their channel's previous style (or omitted copy.md), clone the title/numbering/tone/collection convention from their recent 5 works.
  4. Single-Slot upload_file Serialization:
    • Chrome's OS file chooser handles only one file upload at a time. Never call upload_file concurrently across two tabs in the same turn. You may interleave one upload_file on Tab A with evaluate_script or take_snapshot on Tab B.
  5. Screenshot Isolation:
    • Always select_page to the target tab before calling take_screenshot, and never pair take_screenshot with an active upload_file in the same turn (prevents compositor hangs).
  6. Never close_page on Dirty Upload Forms:
    • Closing a creator tab with unsaved changes or an active upload triggers Chrome's native beforeunload dialog and deadlocks chrome-devtools-mcp's global mutex. If a tab is stuck, open a fresh tab with new_page and leave the old tab alone.
  7. Never Bypass CAPTCHAs or 2FA:
    • If any platform displays a CAPTCHA, human-verification challenge, or login wall, stop on that platform, report it clearly to the user, and proceed with the remaining platforms. Never attempt to solve or click through anti-bot checks.
  8. Mandatory Cover Visual Audit:
    • Custom covers (especially on Douyin and YouTube) must be visually confirmed via take_screenshot inside the preview modal before clicking Publish and again on the content management page after publishing.
  9. Respect Draft vs. Immediate Publish Intent:
    • If the user asks to "save as draft / schedule / upload without publishing" (or specifies --visibility unlisted/private/draft), stop at the draft/unlisted state instead of publishing publicly.

Universal 5-Stage Publishing Workflow

Stage 0 — First-Run Environment Auto-Bootstrap (Fresh Machine / Codex Ready)

Before touching any browser tab, check whether chrome-devtools MCP tools (list_pages, upload_file, evaluate_script, take_screenshot) are present in your active toolset.

  1. If chrome-devtools MCP tools ARE already available and ffmpeg works: skip directly to Stage 1.
  2. If chrome-devtools MCP tools are MISSING (or ffmpeg is missing), run the bundled zero-dependency bootstrapper immediately:
    python scripts/bootstrap.py --check --json
    
  3. Inspect the JSON report and apply automated setup for the active client (codex, claude, antigravity, gemini, cursor, or auto):
    python scripts/bootstrap.py \
      --apply \
      --client auto \
      --install-mcp \
      --install-ffmpeg
    
    What scripts/bootstrap.py automatically handles for the user:
    • Installs a bundled ffmpeg (pip install --user imageio-ffmpeg, zero admin rights required) if ffmpeg is absent.
    • Installs chrome-devtools-mcp@latest into a pure-ASCII local directory (~/.omni-video-publisher/mcp or an ASCII drive fallback on Windows) and resolves the direct node + JS binary entrypoint — eliminating Windows npx.cmd ENOENT failures in Codex (Rust/Tokio) and starting 5× faster.
    • Auto-detects the machine's real pure-ASCII workspace roots (no hardcoded D:\ or E:\ paths).
    • Backs up existing config (*.bak) and writes clean UTF-8 (no BOM) MCP entries — including [mcp_servers.chrome-devtools] with startup_timeout_sec = 30 and tool_timeout_sec = 180 in ~/.codex/config.toml for Codex (so large video uploads never hit default 60s tool timeouts!).
    • Automatically selects --autoConnect for Chrome v144+ or --browserUrl=http://127.0.0.1:9222 fallback for older Chrome.
  4. If Node.js < 20 or Chrome is not installed at all, instruct the user to install Node.js 20+ (e.g., winget install OpenJS.NodeJS.LTS / brew install node) or Google Chrome, then re-run bootstrap.py.
  5. Finish the one-time handoff cleanly: once bootstrap.py --apply succeeds, stop and tell the user only the 2 human actions required by Chrome's security model:
    • Open chrome://inspect/#remote-debugging in Chrome, toggle remote debugging ON, click Allow, and log into the creator studios you want to publish to.
    • Restart / reload your agent session (e.g., restart codex, or click Refresh MCP) so the newly registered chrome-devtools tools load — then repeat your publish prompt.

Stage 1 — Prepare & Validate Asset Package (or Auto-Clone Style From History)

Path A — User Provided a Copy File (copy.md / .txt / .json) or Inline Title/Body

Run the bundled universal adapter against any local video + copy:

python scripts/prepare_package.py \
  --video "/path/to/video.mp4" \
  --copy "/path/to/copy.md" \
  --platforms "xhs,bilibili,douyin,x,youtube" \
  --auto-proxy \
  --auto-covers \
  --out "/path/to/publish_plan.json"

If the user passed inline text without creating a copy.md, pass --title "..." --body "..." --tags "tag1,tag2" directly (no file needed!).

Path B — User Provided Only a Video & Asked to Match Their Account's Past Style (History-Aware Style Clone)

  1. Attach to Chrome (Stage 2) and visit the user's management page on their primary platform (new/note-manager, content/manage?tab=works, or upload-manager/article).
  2. Run the read-only Section 0 History Style Reader script from references/dom-playbook-5platforms.md to read their latest 5 published titles, numbering pattern (e.g. 05 → 06), series prefix, description tone, common tags, and collection name.
  3. Synthesize a clean copy.md next to the video following examples/sample-bundle/copy.md, then run scripts/prepare_package.py as in Path A.

Key prepare_package.py flags:

  • --copy: Structured Markdown (global defaults + optional ## 小红书 / ## B站 / ## 抖音 / ## X / ## YouTube sections), plain text, or JSON.
  • --title, --body, --tags, --url: Inline overrides allowing execution with zero copy file.
  • --cover-3x4, --cover-4x3, --cover-16x9: Pass custom covers explicitly; with --auto-covers, any missing ratio is extracted from the sharpest high-contrast keyframe (or smart-cropped via Lanczos from an existing cover) using ffmpeg.
  • --auto-proxy: Generates a CRF 22 _Share.mp4 (bt709, yuv420p, faststart) when master exceeds 55 MB, speeding up Xiaohongshu & X uploads by ~2× while preserving HD status.
  • --visibility: public (default), unlisted, private, or draft.
  • --schedule: Optional ISO-8601 timestamp (2026-12-01T18:00:00+08:00).

Inspect publish_plan.json and confirm status == "ready" with zero blocking errors.


Stage 2 — Attach to Logged-In External Chrome

  1. Call list_pages via chrome-devtools MCP.
    • If unreachable, confirm Chrome is running with chrome://inspect/#remote-debugging enabled (or re-run python scripts/bootstrap.py --check to verify MCP config).
  2. Open or select one clean creator tab per requested target platform:
    • Xiaohongshu: https://creator.xiaohongshu.com/publish/publish
    • Bilibili: https://member.bilibili.com/platform/upload/video/frame
    • Douyin: https://creator.douyin.com/creator-micro/content/upload
    • X (Twitter): https://x.com/compose/post
    • YouTube Studio: https://studio.youtube.com
  3. Verify each tab is logged in (no login wall) and record the active account handle/name.

Stage 3 — Execute Platform-Native Uploads

Follow the exact DOM & JS playbooks in references/dom-playbook-5platforms.md. Process uploads cleanly with at most one upload_file per turn:

  1. 小红书 (Xiaohongshu):
    • upload_file _Share.mp4 (or master if ≤55 MB) → wait for 检测为高清视频.
    • Fill Title (≤20 chars) → focus .tiptap.ProseMirror & insert URL-free body → trigger clickable [话题] chips via #keyword + #creator-editor-topic-container .item.
    • Optionally select Collection (选择合集) and toggle 原创声明 via strict smallest-ancestor .d-switch-simulator (never toggle PK封面).
    • Upload cover-3x4.jpg via .cover-edit-entry → 完成 → wait for 封面效果评估通过 → click 发布 (or 暂存离开 for draft).
  2. B站 (Bilibili):
    • upload_file master .mp4 onto "上传视频" (never hidden bottom 选择文件).
    • Overwrite Title (≤80 chars) via native HTMLInputElement.prototype.value setter (never raw fill, which appends to the filename).
    • Set .ql-editor <p> lines → set partition via .select-controller (知识 / 科技 / user choice) → scrub bogus AI auto-tags (REACTION, 影视剪辑, 记录, etc.) → add topic/tags (cap 10).
    • Upload cover-4x3.jpg (or cover-16x9.jpg for landscape) via 添加封面 → 上传封面 → expose image file input → upload_file → 完成.
    • Scroll & click 立即投稿 (or 存草稿) → confirm 稿件投递成功.
  3. 抖音 (Douyin):
    • upload_file master .mp4 onto 选择文件.
    • Fill Title (≤30 chars) → click DraftJS description editor & type_text URL-free body + #tag1 #tag2 (trailing spaces convert tags to clickable chips) → optionally pick official campaign/collection.
    • Open 选择封面 (竖封面3:4) → 上传封面 → expose ONLY the input[type="file"].semi-upload-hidden-input inside 点击上传文件或拖拽文件到这里 → upload_file cover-3x4.jpg → screenshot modal preview → click 完成 → wait until modal closes + 1.8s → click 发布 (or 存草稿).
  4. X / Twitter:
    • Open https://x.com/compose/post → confirm [data-testid="tweetTextarea_0"] is visible.
    • upload_file MP4 (≤512 MB, H.264/AAC; standard accounts ≤140s, X Premium longer) onto input[data-testid="fileInput"] → wait until upload progress reaches 100% / video preview renders.
    • Insert adapted post text (280-weighted-char standard cap: CJK=2, URL=23) into [data-testid="tweetTextarea_0"].
    • If x_thread_replies is non-empty, click [data-testid="addButton"] and fill each reply tweet sequentially.
    • Click [data-testid="tweetButton"] (Post) — or stop at draft if requested — and verify "Your post was sent".
  5. YouTube / YouTube Shorts:
    • Open https://studio.youtube.com → click Create (#create-icon) → Upload videos.
    • upload_file master .mp4 onto input[type="file"][name="Filedata"].
    • Wait for ytcp-uploads-dialog: set Title (≤100), Description (≤5000), optional cover-16x9.jpg thumbnail (non-Shorts), Audience (VIDEO_MADE_FOR_KIDS_NOT_MFK), and optional Tags.
    • Advance #next-button through Video elements → Checks → Visibility → select PUBLIC/UNLISTED/PRIVATE/Schedule → click #done-button → capture https://youtu.be/<VIDEO_ID> or https://youtube.com/shorts/<VIDEO_ID>.

Stage 4 — Post-Publish Visual Verification & Final Report

  1. Visit each platform's management/profile tab one at a time, select_page, and take a verification take_screenshot to confirm:
    • Video published / under review (zero failed uploads),
    • Custom covers rendered (no black frame on Douyin/XHS/Bilibili/YouTube),
    • Correct account and clean formatting.
  2. Output a concise Markdown summary table:
PlatformAccountTitleMode / VisibilityCoverURL / ID / Status
小红书......Published3:4 VerifiedLive / Reviewing
B站......Published4:3 VerifiedBV...
抖音......Published3:4 VerifiedLive / Reviewing
X@......Published (+Thread)Video Framehttps://x.com/...
YouTube......Public / ShortsAuto / 16:9https://youtu.be/...

相关技能