Social Auto Upload Bridge
Role
Use social-auto-upload as the guarded local video uploader for 小红书、抖音、B站和视频号. It is a project-local upstream dependency kept under vendor/publish/, excluded from the main repository, and independently updateable.
Default root:
${SOCIAL_AUTO_UPLOAD_ROOT:-${DASHENG_PROJECT_ROOT:-.}/vendor/publish/social-auto-upload}
When To Use
- Publish has a completed video
channel_pack.json. - The target channel is
xiaohongshu_video,douyin_video,bilibili_video, orwechat_channels_video. - A completed
channel_pack.jsoncontains the final MP4 and platform metadata. - The account is represented by an explicit
account_nameor stableaccount_slot; default isslot-1.
Inputs
channel_pack.json- Final MP4 path
- Title, description, tags, cover if available
- Platform account/session already configured in the external project
Workflow
- Check upstream registry:
python3 scripts/check_publish_upstreams.py --name social-auto-upload - Check local external repo exists and is healthy.
- Convert
channel_pack.jsoninto the external project's expected upload config.python3 scripts/build_video_upload_package.py --channel-pack <channel_pack.json> - Build the exact login-check and upload command without publishing:
python3 scripts/execute_social_auto_upload.py --channel-pack <channel_pack.json> - Show the platform, account slot, title, video, cover, schedule and generated command for review.
- Only after explicit current-session confirmation run:
python3 scripts/execute_social_auto_upload.py \ --channel-pack <channel_pack.json> \ --confirm-execute - The executor must run
sau <platform> check --account <account>before upload. Invalid login blocks execution and returns the headed login command. - Write results back under
~/Desktop/自媒体创作/<run_id>/05_发布/channel_packs/...and keep verification asneeds_manual_verificationuntil a platform URL or draft ID is recovered.
For two-version, multi-account distribution, build a Campaign first. The campaign owns platform-specific titles, descriptions, tags, covers, activity state and logical-account routing; this bridge only executes each frozen task package:
python3 scripts/build_publish_campaign.py --spec <campaign_spec.json> --output-dir <run_dir>
python3 scripts/publish_accounts.py --check-auth --output <run_dir>/account_auth_report.json
python3 scripts/build_publish_campaign.py --spec <campaign_spec.json> --output-dir <run_dir>
python3 scripts/execute_publish_campaign.py --campaign <run_dir>/publish_campaign.json
Platform Mapping
| Newma channel | sau platform |
Notes |
|---|---|---|
xiaohongshu_video |
xiaohongshu |
Video, cover, tags and schedule |
douyin_video |
douyin |
Video, cover, tags and schedule |
bilibili_video |
bilibili |
Requires platform_notes.tid or category_id |
wechat_channels_video |
tencent |
Supports short title, category, draft and dual cover hints |
Douyin activities are discovered live through OpenCLI when available. Pass platform_notes.activity_selected only after editorial confirmation. Pass platform_notes.declaration only when the exact Douyin option text was explicitly approved; never infer it.
Account Slots
platform_notes.account_namehas highest priority.platform_notes.account_slot: 1maps toslot-1; slot 2 maps toslot-2.- Login state belongs under
~/Library/Application Support/NewmaPublishSessions/social-auto-upload/cookies/. The ignored upstreamcookies/path is only a symlink to this secure state directory. - Login must be performed interactively with the relevant
sau <platform> login --account <slot> --headedcommand. - Account aliases, slots and auth methods are registered in
configs/publish/account_registry.json; the registry contains no secrets or cookies. - Initialize or audit account storage with
python3 scripts/publish_accounts.py --initand validate sessions withpython3 scripts/publish_accounts.py --check-auth.
Hard Rules
- Never copy generated videos or credentials into
skills/. - Never commit the nested upstream repository, its
.venv, cookies, logs, or browser state into the main repository. - Never execute final publish without explicit current-session confirmation.
auto_confirmis not accepted by the guarded executor. - If login, CAPTCHA, cookie, or upload permission fails, export a manual package and mark the execution
fallback_export. - Always run Publish Guard or platform-specific verification before reporting success.
- A zero CLI exit code means only “upload command completed”; it is not proof of publication.
- Use headed mode by default for browser-based platforms to reduce login and anti-bot failures.
- Campaign execution requires every primary
social_auto_uploadaccount status to bevalid; browser state alone is not proof that the CLI session is usable. - Never invent or auto-select a platform activity. Unselected activities remain
live_discovery_required.
Upstream
Tracked in:
configs/publish/upstream_repos.json