Douyin Upload Skill
Overview
Use this skill to publish local videos to Douyin with a deterministic CLI flow:
- 1. Validate local dependencies and env.
- OAuth authorize and store encrypted token locally.
- Prepare video metadata and transcript from local audio.
- Generate 3 caption candidates in chat from transcript.
- Confirm or edit caption, then publish.
- If official publish permission is unavailable, export an outbox package for manual publish.
Use the script at <skill_root>/scripts/douyin.js.
Required Environment
Set these environment variables before auth or publish:
- - INLINECODE3
- INLINECODE4
- INLINECODE5
Optional overrides:
- - INLINECODE6
- INLINECODE7
- INLINECODE8 (
api / whisper-gpu / whisper-cpu) - INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
Workflow
- 1. Run dependency checks:
CODEBLOCK0
- 2. Authorize account (manual code paste flow):
CODEBLOCK1
- 3. Prepare transcript and metadata from a local video path. Accept both Linux and Windows path formats.
CODEBLOCK2
- 4. Create 3 caption candidates from
transcript.text with this structure:
- - Line 1: title hook
- Line 2-3: concise description
- Final line: 2-5 hashtags
- 5. Ask user to select or edit one final caption.
- 6. Publish with explicit visibility and confirmation policy:
CODEBLOCK3
Command Behavior
- -
doctor: reports dependency and env readiness plus install hints. - INLINECODE21 : opens OAuth URL, accepts pasted callback URL or
code, stores encrypted token. - INLINECODE23 : returns metadata, transcript, and ASR failure detail (without stopping publish flow).
- INLINECODE24 : uploads and creates video via official API. If permission-like API errors occur, writes fallback files under outbox and returns
mode: fallback. - INLINECODE26 : stores persistent settings (
defaultPrivateStatus, autoConfirm, whisperBin, whisperModelPath, outboxDir, etc.).
Caption Rules
Before publish:
- - Keep final text length <= 1000.
- Always show the final draft to the user.
- If
auto-confirm is false, require explicit user confirmation in terminal.
Output Contracts
Treat script stdout as JSON. Always parse and branch by:
- - INLINECODE33
- INLINECODE34
- INLINECODE35 (
official or fallback for publish) - INLINECODE39 (optional in
prepare)
抖音上传技能
概述
使用此技能通过确定的CLI流程将本地视频发布到抖音:
- 1. 验证本地依赖和环境。
- OAuth授权并将加密令牌存储在本地。
- 从本地音频准备视频元数据和转录文本。
- 从转录文本生成3个候选标题。
- 确认或编辑标题,然后发布。
- 如果官方发布权限不可用,则导出发件箱包以供手动发布。
使用位于<技能根目录>/scripts/douyin.js的脚本。
所需环境
在auth或publish之前设置这些环境变量:
- - DOUYINCLIENTKEY
- DOUYINCLIENTSECRET
- DOUYINREDIRECTURI
可选覆盖项:
- - DOUYINSCOPE
- DOUYINTOKENENCKEY
- DOUYINASRMODE (api / whisper-gpu / whisper-cpu)
- DOUYINASRAPIURL
- DOUYINASRAPIMODEL
- DOUYINASRAPIKEY
- DOUYINWHISPERBIN
- DOUYINWHISPERMODELPATH
- DOUYINFFMPEGBIN
- DOUYINFFPROBEBIN
工作流程
- 1. 运行依赖检查:
bash
node <技能根目录>/scripts/douyin.js doctor
- 2. 授权账户(手动粘贴代码流程):
bash
node <技能根目录>/scripts/douyin.js auth
- 3. 从本地视频路径准备转录文本和元数据。支持Linux和Windows路径格式。
bash
node <技能根目录>/scripts/douyin.js prepare --video E:\\videos\\demo.mp4
- 4. 从transcript.text创建3个候选标题,结构如下:
- - 第1行:标题钩子
- 第2-3行:简洁描述
- 最后一行:2-5个话题标签
- 5. 询问用户选择或编辑一个最终标题。
- 6. 使用明确的可见性和确认策略发布:
bash
node <技能根目录>/scripts/douyin.js publish \
--video E:\\videos\\demo.mp4 \
--text <最终标题> \
--private-status 0 \
--auto-confirm false
命令行为
- - doctor:报告依赖和环境就绪状态以及安装提示。
- auth:打开OAuth URL,接受粘贴的回调URL或code,存储加密令牌。
- prepare:返回元数据、转录文本和ASR失败详情(不停止发布流程)。
- publish:通过官方API上传和创建视频。如果发生权限类API错误,则在发件箱下写入回退文件并返回mode: fallback。
- config:存储持久设置(defaultPrivateStatus、autoConfirm、whisperBin、whisperModelPath、outboxDir等)。
标题规则
发布前:
- - 保持最终文本长度<=1000。
- 始终向用户显示最终草稿。
- 如果auto-confirm为false,则在终端中要求用户明确确认。
输出约定
将脚本标准输出视为JSON。始终解析并按以下内容分支:
- - ok
- command
- mode(publish的official或fallback)
- asrError(prepare中的可选字段)