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):
| Platform | Creator Studio URL | Video Strategy | Cover Aspect | URL Policy |
|---|---|---|---|---|
| 小红书 (Xiaohongshu) | https://creator.xiaohongshu.com/publish/publish | CRF 22 _Share.mp4 (passes 高清视频, 2× faster) | 3:4 | Strip raw https:// |
| B站 (Bilibili) | https://member.bilibili.com/platform/upload/video/frame | Master .mp4 | 4:3 or 16:9 | Keep clean links |
| 抖音 (Douyin) | https://creator.douyin.com/creator-micro/content/upload | Master .mp4 | 3:4 vertical | Strip raw https:// |
| X (Twitter) | https://x.com/compose/post | Master / ≤512 MB MP4 (H.264/AAC) | Optional video thumb | Keep links (23-char t.co) |
| YouTube / Shorts | https://studio.youtube.com | Master .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: readreferences/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
- 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-devtoolsMCP tools orffmpegare missing. Runscripts/bootstrap.pyfirst to diagnose and configure the client automatically, then ask the user only for the two browser-security steps Chrome mandates (togglingchrome://inspect/#remote-debuggingON + restarting the agent session once).
- On a fresh machine (especially Codex, Claude Code, Gemini CLI, or Antigravity), NEVER give up just because
- Always Run
scripts/prepare_package.pyBefore 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.mp4proxy, and emit a deterministicpublish_plan.json.
- Never eyeball title lengths, aspect ratios, codec compatibility, or link policies. Run the CLI adapter to inspect the video (
- 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.comContent 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 omittedcopy.md), clone the title/numbering/tone/collection convention from their recent 5 works.
- Before uploading on any platform, check the currently logged-in account badge and recent uploads (
- Single-Slot
upload_fileSerialization:- Chrome's OS file chooser handles only one file upload at a time. Never call
upload_fileconcurrently across two tabs in the same turn. You may interleave oneupload_fileon Tab A withevaluate_scriptortake_snapshoton Tab B.
- Chrome's OS file chooser handles only one file upload at a time. Never call
- Screenshot Isolation:
- Always
select_pageto the target tab before callingtake_screenshot, and never pairtake_screenshotwith an activeupload_filein the same turn (prevents compositor hangs).
- Always
- Never
close_pageon Dirty Upload Forms:- Closing a creator tab with unsaved changes or an active upload triggers Chrome's native
beforeunloaddialog and deadlockschrome-devtools-mcp's global mutex. If a tab is stuck, open a fresh tab withnew_pageand leave the old tab alone.
- Closing a creator tab with unsaved changes or an active upload triggers Chrome's native
- 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.
- Mandatory Cover Visual Audit:
- Custom covers (especially on Douyin and YouTube) must be visually confirmed via
take_screenshotinside the preview modal before clicking Publish and again on the content management page after publishing.
- Custom covers (especially on Douyin and YouTube) must be visually confirmed via
- 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.
- If the user asks to "save as draft / schedule / upload without publishing" (or specifies
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.
- If
chrome-devtoolsMCP tools ARE already available andffmpegworks: skip directly to Stage 1. - If
chrome-devtoolsMCP tools are MISSING (orffmpegis missing), run the bundled zero-dependency bootstrapper immediately:python scripts/bootstrap.py --check --json - Inspect the JSON report and apply automated setup for the active client (
codex,claude,antigravity,gemini,cursor, orauto):
Whatpython scripts/bootstrap.py \ --apply \ --client auto \ --install-mcp \ --install-ffmpegscripts/bootstrap.pyautomatically handles for the user:- Installs a bundled
ffmpeg(pip install --user imageio-ffmpeg, zero admin rights required) ifffmpegis absent. - Installs
chrome-devtools-mcp@latestinto a pure-ASCII local directory (~/.omni-video-publisher/mcpor an ASCII drive fallback on Windows) and resolves the directnode+ JS binary entrypoint — eliminating Windowsnpx.cmdENOENTfailures in Codex (Rust/Tokio) and starting 5× faster. - Auto-detects the machine's real pure-ASCII workspace roots (no hardcoded
D:\orE:\paths). - Backs up existing config (
*.bak) and writes clean UTF-8 (no BOM) MCP entries — including[mcp_servers.chrome-devtools]withstartup_timeout_sec = 30andtool_timeout_sec = 180in~/.codex/config.tomlfor Codex (so large video uploads never hit default 60s tool timeouts!). - Automatically selects
--autoConnectfor Chromev144+or--browserUrl=http://127.0.0.1:9222fallback for older Chrome.
- Installs a bundled
- If Node.js
< 20or 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-runbootstrap.py. - Finish the one-time handoff cleanly: once
bootstrap.py --applysucceeds, stop and tell the user only the 2 human actions required by Chrome's security model:- Open
chrome://inspect/#remote-debuggingin 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 registeredchrome-devtoolstools load — then repeat your publish prompt.
- Open
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)
- Attach to Chrome (Stage 2) and visit the user's management page on their primary platform (
new/note-manager,content/manage?tab=works, orupload-manager/article). - Run the read-only Section 0 History Style Reader script from
references/dom-playbook-5platforms.mdto read their latest 5 published titles, numbering pattern (e.g.05 → 06), series prefix, description tone, common tags, and collection name. - Synthesize a clean
copy.mdnext to the video followingexamples/sample-bundle/copy.md, then runscripts/prepare_package.pyas in Path A.
Key prepare_package.py flags:
--copy: Structured Markdown (global defaults + optional## 小红书/## B站/## 抖音/## X/## YouTubesections), 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) usingffmpeg.--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, ordraft.--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
- Call
list_pagesviachrome-devtoolsMCP.- If unreachable, confirm Chrome is running with
chrome://inspect/#remote-debuggingenabled (or re-runpython scripts/bootstrap.py --checkto verify MCP config).
- If unreachable, confirm Chrome is running with
- 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
- Xiaohongshu:
- 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:
- 小红书 (Xiaohongshu):
upload_file_Share.mp4(or master if ≤55 MB) → wait for检测为高清视频.- Fill Title (
≤20chars) → 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 togglePK封面). - Upload
cover-3x4.jpgvia.cover-edit-entry→完成→ wait for封面效果评估通过→ click发布(or暂存离开for draft).
- B站 (Bilibili):
upload_filemaster.mp4onto"上传视频"(never hidden bottom选择文件).- Overwrite Title (
≤80chars) via nativeHTMLInputElement.prototype.valuesetter (never rawfill, 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(orcover-16x9.jpgfor landscape) via添加封面→上传封面→ expose image file input →upload_file→完成. - Scroll & click
立即投稿(or存草稿) → confirm稿件投递成功.
- 抖音 (Douyin):
upload_filemaster.mp4onto选择文件.- Fill Title (
≤30chars) → click DraftJS description editor &type_textURL-free body +#tag1 #tag2(trailing spaces convert tags to clickable chips) → optionally pick official campaign/collection. - Open
选择封面(竖封面3:4) →上传封面→ expose ONLY theinput[type="file"].semi-upload-hidden-inputinside点击上传文件或拖拽文件到这里→upload_filecover-3x4.jpg→ screenshot modal preview → click完成→ wait until modal closes +1.8s→ click发布(or存草稿).
- X / Twitter:
- Open
https://x.com/compose/post→ confirm[data-testid="tweetTextarea_0"]is visible. upload_fileMP4 (≤512 MB, H.264/AAC; standard accounts ≤140s, X Premium longer) ontoinput[data-testid="fileInput"]→ wait until upload progress reaches100%/ video preview renders.- Insert adapted post text (
280-weighted-char standard cap: CJK=2, URL=23) into[data-testid="tweetTextarea_0"]. - If
x_thread_repliesis 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".
- Open
- YouTube / YouTube Shorts:
- Open
https://studio.youtube.com→ click Create (#create-icon) → Upload videos. upload_filemaster.mp4ontoinput[type="file"][name="Filedata"].- Wait for
ytcp-uploads-dialog: set Title (≤100), Description (≤5000), optionalcover-16x9.jpgthumbnail (non-Shorts), Audience (VIDEO_MADE_FOR_KIDS_NOT_MFK), and optional Tags. - Advance
#next-buttonthrough Video elements → Checks → Visibility → selectPUBLIC/UNLISTED/PRIVATE/Schedule → click#done-button→ capturehttps://youtu.be/<VIDEO_ID>orhttps://youtube.com/shorts/<VIDEO_ID>.
- Open
Stage 4 — Post-Publish Visual Verification & Final Report
- Visit each platform's management/profile tab one at a time,
select_page, and take a verificationtake_screenshotto confirm:- Video published / under review (zero failed uploads),
- Custom covers rendered (no black frame on Douyin/XHS/Bilibili/YouTube),
- Correct account and clean formatting.
- Output a concise Markdown summary table:
| Platform | Account | Title | Mode / Visibility | Cover | URL / ID / Status |
|---|---|---|---|---|---|
| 小红书 | ... | ... | Published | 3:4 Verified | Live / Reviewing |
| B站 | ... | ... | Published | 4:3 Verified | BV... |
| 抖音 | ... | ... | Published | 3:4 Verified | Live / Reviewing |
| X | @... | ... | Published (+Thread) | Video Frame | https://x.com/... |
| YouTube | ... | ... | Public / Shorts | Auto / 16:9 | https://youtu.be/... |