← 返回
未分类

抖音自动发布

Use when publishing to Douyin, logging in to Douyin creator accounts, scheduling Douyin videos, or troubleshooting Douyin uploads that hang, fail, miss covers, or get stuck on creator.douyin.com.
Use when publishing to Douyin, logging in to Douyin creator accounts, scheduling Douyin videos, or troubleshooting Douyin uploads that hang, fail, miss covers, or get stuck on creator.douyin.com.
user_929917a3
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 48
下载
💾 0
安装
1
版本
#latest

概述

Douyin Publisher

Automate publishing videos to the Douyin creator platform (creator.douyin.com) with Playwright browser automation.

发布前检查

发布前必须先确认这些条件,避免上传到一半才失败:

  1. 确认视频文件存在,并用双引号包住完整路径。
  2. 确认 --title 已提供,标题不超过 55 个字符。
  3. 正式发布必须带 --cover。优先使用同一 exports/ 目录下最新的 cover.pngcover.jpg封面 文件;没有封面时先生成封面再发布。
  4. 先运行 pnpm run douyin:status,只有 Live check: Logged in 才继续发布。
  5. 默认公开发布时不要额外依赖点击“公开”。脚本应把 public 当成默认状态;只有 privatefriends 才需要主动切换可见性。

如果需要从视频生成临时封面:

ffmpeg -y -ss 00:00:01 -i "/path/to/video.mp4" -frames:v 1 "/path/to/cover.png"

Install

From the skill root, install dependencies and the Chromium browser:

pnpm install
pnpm exec playwright install chromium

Create a local environment file when overriding defaults. If .env is missing, create it directly:

if [ ! -f .env ]; then
  cat > .env <<'EOF'
# Douyin session storage directory (cookies, localStorage)
DOUYIN_SESSION_DIR=~/.douyin-sessions

# Default session name
DOUYIN_DEFAULT_SESSION=default

# Browser options
DOUYIN_HEADLESS=false
DOUYIN_BROWSER_CHANNEL=chromium

# Upload defaults
DOUYIN_DEFAULT_VISIBILITY=public

# Timeout settings (milliseconds)
DOUYIN_UPLOAD_TIMEOUT=600000
DOUYIN_LOGIN_TIMEOUT=300000
EOF
fi

When this skill is vendored inside a project that already has dependencies installed, the project can call scripts/douyin-publish.ts directly. For SkillHub distribution, keep package.json and all runtime code inside this skill directory.

Environment

Optional .env values:

  • DOUYIN_SESSION_DIR: session storage directory, default ~/.douyin-sessions
  • DOUYIN_HEADLESS: set true for headless mode, default false
  • DOUYIN_BROWSER_CHANNEL: Playwright browser channel, default chromium
  • DOUYIN_UPLOAD_TIMEOUT: upload timeout in milliseconds, default 600000
  • DOUYIN_LOGIN_TIMEOUT: login timeout in milliseconds, default 300000

Commands

Login is required before publishing:

pnpm run douyin:login
pnpm run douyin:login -- --method sms --phone 13800138000
pnpm run douyin:login -- --session account1

Publish a video:

pnpm run douyin:publish ./video.mp4 --title "My first video" --cover ./cover.jpg
pnpm run douyin:publish ./video.mp4 \
  --title "My video title" \
  --description "Video description" \
  --tags travel food \
  --cover ./cover.jpg \
  --session account1

Schedule a video:

pnpm run douyin:publish ./video.mp4 \
  --title "Scheduled video" \
  --cover ./cover.jpg \
  --schedule "2026-06-01T10:00:00+08:00"

For native datetime-local controls, the script fills YYYY-MM-DDTHH:mm from the provided schedule value.

Do not add an extra -- after pnpm run douyin:publish in this package. In the observed pnpm setup, the extra separator was forwarded as a literal video argument and caused --title to be missed.

Check session status:

pnpm run douyin:status
pnpm run douyin:status -- --session account1

Utility Script

The executable entrypoint lives inside this skill:

pnpm exec tsx scripts/douyin-publish.ts --help

Runtime modules live under scripts/douyin/. Keep helper scripts for this workflow under scripts/ in this skill directory so the skill remains self-contained when published.

How It Works

  1. Uses Playwright with a stealth plugin to simulate a real browser.
  2. Stores named browser sessions in ~/.douyin-sessions//state.json.
  3. Opens a browser for manual QR scan or SMS verification when logging in.
  4. Automates the creator upload page, metadata entry, optional cover upload, scheduling, and publish confirmation.
  5. Writes upload screenshots to debug-output/ for troubleshooting.

Troubleshooting

Use debug-output/publish-*/ checkpoints to locate the failure:

  • 01-upload-page-loaded and 02-video-file-selected only: video entered the page, then processing or required metadata blocked.
  • metadata-filled missing with an error like locator.click: Timeout ... waiting for locator('text=公开') and : do not click default public; keep public as the default and retry after verifying the script skips that click.
  • cover-uploaded missing: rerun with an explicit --cover path. Missing cover can leave the page in a state where publish controls stay disabled or downstream clicks become unreliable.
  • publish-button-enabled missing: inspect the screenshot for incomplete title, cover, originality/terms controls, or account prompts.
  • publish-success present with Status: reviewing: the publish request succeeded and Douyin is reviewing the video.

Recommended retry command after a cover-related failure:

pnpm run douyin:publish "/path/to/video.mp4" \
  --title "视频标题" \
  --cover "/path/to/cover.png"

Limitations

  • First login requires manual QR scan or SMS code entry.
  • Captcha challenges require manual intervention.
  • Douyin UI selectors may change and require script updates.
  • Video processing and review happen server-side after submission.

版本历史

共 1 个版本

  • v1.0.0 Initial release 当前
    2026-06-02 02:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 931 📥 210,960
content-creation

Marketing Mode

thesethrose
{"answer":"营销模式整合23项全能技能,涵盖策略、心理、内容、SEO、转化优化及付费增长。适用于营销策略、文案、SEO、转化优化、付费广告及各类营销战术需求。"}
★ 162 📥 25,288
content-creation

humanizer-zh

liuxy951129-cpu
去除文本中的 AI 生成痕迹。适用于编辑或审阅文本,使其听起来更自然、更像人类书写。 基于维基百科的"AI 写作特征"综合指南。检测并修复以下模式:夸大的象征意义、 宣传性语言、以 -ing 结尾的肤浅分析、模糊的归因、破折号过度使用、三段
★ 64 📥 30,499