What does DouChuang Workshop do?
TikTok video capture → transcription → AI rewriting → video generation, with automatic publishing to TikTok (images/text) and Toutiao (articles)
🚀 Two Automated Publishing Paths (Core Capability)
Both TikTok image/text and Toutiao articles can be automatically submitted to the platform from the local machine's browser — each with package-level preview, per-field character count validation, and publishing options, requiring confirmation before submission:
| Path | Engine | Login Method | Key Constraints |
|---|---|---|---|
| TikTok Image/Text | External social-auto-upload CLI (optional) | Reuse existing TikTok login session | Only one task at a time; no automatic retries |
| Toutiao Article | Custom Executor (Playwright, using bundled headless Chromium) | QR code scan (in-app QR code / browser window) | AI-generated article + 16:9 cover; cover is required |
Common discipline for both paths: each step reads back and validates (if any step fails, it stops before the 'Publish' button and notes exactly which step failed); after submission, only record as 'Submitted', actual publication is verified by a human on the platform backend and then marked as 'Published'; never automatically retry (before retrying, must first confirm if the previous attempt was actually published — duplicate publishing is the biggest risk). Videos and other platforms (Xiaohongshu / Video Account / Bilibili) are still primarily manually delivered.
The publishing center is organized by channel (TikTok Image/Text / Toutiao Article / Video Manual Delivery). The three channels are independent and are not mixed together.
Capability Overview
A local desktop tool for content review and secondary creation. The current main pipeline focuses on: downloading videos, extracting audio, built-in Whisper transcription, AI rewriting, generating video storyboards, and optionally using HyperFrames for local 9:16 MP4 rendering. Supports batch collection from user profiles, direct signature API calls, watermark-free video downloads, incremental collection updates. New tasks use a manual step-by-step execution process, with each step supporting automatic 3 retries and manual retry after failure.
⚠️ Disclaimer: This project is for learning and technical research purposes only. Users should comply with the terms of service and laws of the relevant platforms. Do not use this project for any commercial purposes or infringe upon third-party rights. The author is not responsible for any consequences arising from the use of this project.
🤝 Looking for Contributors
This project is currently maintained by an individual. Contributions are welcome!
Areas where help is particularly needed:
- Maintenance of TikTok signature stability (a_bogus / X-Bogus)
- Optimization of Whisper model size and Chinese accuracy
- HyperFrames video styles / TTS voiceover
- UI/UX improvements and Windows packaging testing
- Documentation, test cases, sample videos
→ View Contribution Guidelines | Submit an Issue | Discussions
Core Features
Manual Step-by-Step Flow
Input: TikTok share link / share text / user profile link
↓
Create Task / Collection: Parse and save input, do not automatically run the full pipeline
↓
User confirms execution step by step:
1️⃣ Download video (watermark-free priority → signature API → yt-dlp)
2️⃣ Extract audio (ffmpeg → 16kHz mono WAV)
3️⃣ ASR to text (built-in whisper.cpp)
4️⃣ AI rewriting
5️⃣ Generate video prompts / storyboards
6️⃣ Generate local portrait video (optional, HyperFrames)
7️⃣ Publishing center delivery (optional; TikTok image/text and Toutiao articles can be automatically submitted, then verified manually)
↓
Output: 📝 Structured transcription + ✍️ Rewritten content + 🎬 MP4 + 📦 Publishing delivery package
Feature Highlights
- ✅ Video Download — Prioritize watermark-free download, support signature API and yt-dlp multi-strategy fallback
- ✅ User Profile Collection — Input a creator's profile link to batch retrieve all their works
- ✅ Collection Management — Create collections by creator, batch create subtasks, batch execute steps
- ✅ Incremental Collection Update — One-click check for a creator's new videos, deduplicate and append to existing collections
- ✅ Direct Signature API Call — a_bogus + X-Bogus signature, bypassing the browser to directly call TikTok internal APIs
- ✅ Cookie Management — Support two methods for obtaining login state: QR code login and manual cookie paste
- ✅ Audio Extraction — Use ffmpeg to extract standardized audio and save the audio manifest
- ✅ Speech Transcription — Built-in whisper.cpp + ggml-small, complete Chinese transcription locally
- ✅ Offline ASR — No need for ASR API Key, Python, FunASR, or faster-whisper
- ✅ AI Rewriting — Based on transcription, produce title, summary, key points, rewritten content, script, and quality prompts
- ✅ Video Storyboard Generation — Based on rewritten content, generate video prompts and storyboard scripts
- ✅ Skill Knowledge Distillation — AI distillation from collection transcription text to generate a Claude Code Skill (SKILL.md)
- ✅ Skill Management — Independent Skill management page, support viewing, renaming, and deleting generated Skills
- ✅ Local Video Generation — Use HyperFrames CLI to render rewritten content and subtitle timing into 9:16 MP4
- ✅ Original Video Review — Detail page allows switching between 'Original Video / Final Video', directly reviewing the TikTok original downloaded during transcription
- ✅ Asset Library — Independent 'Assets' page for manual upload and management of images and audio (images optional for image/text publishing)
- ✅ Publishing Center — Organize final videos into independent delivery packages, generate simplified Chinese copy for four platforms; organize by channel, track progress and manual publication tracking
- ✅ Toutiao Article Publishing — AI-generated article + 16:9 cover + QR code login, automatically submitted to Toutiao account (preview required before submission, verified by human before marking as 'Published'). Successfully tested on real device 2026-09-20
- ✅ Collapsible Sidebar — Desktop left navigation can be expanded/collapsed, showing text labels when expanded, pure icons when collapsed
- ✅ Task Trash — Deleted tasks are retained for 30 days, can be restored or permanently deleted
- ✅ Multiple AI Models — Supports DeepSeek, OpenAI, and OpenAI-compatible relay services
- ✅ Desktop Application — Based on Electron, supports macOS and Windows
- ✅ Real-time Feedback — Task progress updates in real-time, detailed display of each step's status and errors
Local Operator and Permissions
- Login, account switching, and user management interfaces are removed for the end user: the application automatically obtains a 'Local Operator' session on startup, no login or account selection required.
- The automatic session prioritizes using an existing enabled administrator (deterministically selected by
createdAt/idascending); only creates a 'Local User' without a PIN if no administrator exists. It will not delete or rename any historical users. - The interface contract for the administrator PIN has not been relaxed: directly calling
POST /api/local-sessionsto open an administrator session still requires providing the correct PIN. The no-PIN branch only exists on the explicitly named pathPOST /api/local-sessions/auto. - Roles still determine publishing permissions and auditing: retracting a published status, deleting/restoring a delivery package are administrator operations; each audit record still includes an
actorsnapshot. In single-machine use, the current operator is the administrator, so these operations are all available. - Local roles are used for workflow permission control and operator auditing. They are not cloud accounts or strong security boundaries; someone with access to the local storage or OS account may still be able to read or modify local data.
Publishing Center
- The publishing center, by default, only prepares local delivery packages and assists with manual operations. Videos are not automatically uploaded; TikTok Image/Text optionally calls the external
social-auto-upload(sau) CLI for automatic submission, and preview confirmation is required before submission, and after submission, a human must click 'Mark as Published' to confirm. - Toutiao articles use a different path: a custom Playwright executor (using the bundled
chrome-headless-shell, zero additional downloads), completing publication via 'rewritten content → AI article generation → article package (article.html+ 16:9 cover) → preview → submission'. Login is only possible via QR code (Toutiao has no pasteable credentials): Go to 'Settings → Toutiao' and click 'QR Code Login' (displays a QR code in the app) or 'Open Browser to Scan QR Code' (opens a real browser window); the login state is saved in a persistent profile within storage. After scanning once, subsequent publications and self-checks do not require re-scanning. Related environment variables:TOUTIAO_BROWSER_BINARY(browser path, default resolved via 'explicit config → packaged resources → Playwright cache → system Chrome'),TOUTIAO_PROFILE_DIR(session directory, must be within storage). Every step has read-back validation: if any step fails, it stops before clicking 'Publish'; 'Simultaneously publish to Toutiao Microblog' is disabled by default and will not publish if it cannot be turned off. - Same invariant as the TikTok path: the machine only sends the content, records it as 'Submitted';
task.statusremains unchanged throughout, and never automatically retries (before retrying, you must first confirm whether the previous attempt was actually published — duplicate publishing is the biggest risk of this feature). - The publishing center itself does not save platform credentials; when using automatic image/text publishing, it converts the existing TikTok login state (
~/.douyin-ai-video/douyin-cookie.txt) into a Playwrightstorage_stateand writes it to<SAU_BASE_DIR>/cookies/douyin_<account>.json(permissions 600) for use by the external engine. - From the generated final video on the task detail page, enter 'Add to Publishing Center' via a wizard: "Final Video → Platform → Copy → Schedule → Confirm" to create a delivery package.
- Supports TikTok, Xiaohongshu, WeChat Video Account, and Bilibili; one delivery package can contain multiple platform tasks, and independent versions can be created for the same final video.
- Copy is primarily generated by the current AI configuration per platform; if AI is unavailable, it falls back to the rewritten content and is clearly marked as fallback copy. User-edited content is recorded as user edits.
- Organized by channel: Top-level tabs 'TikTok Image/Text / Toutiao Article / Video Manual Delivery' — the submission methods are completely different for the three (first two are automatic submission, the third is purely manual delivery), each with a package count and description. Channels and statuses are recorded in the URL (
?channel=). TikTok Image/Text and Toutiao Article each only have one platform, so these channels do not display a platform dropdown. - The publishing center provides manual assistive operations such as copying titles/body copy/tags, opening platform pages, locating videos in Finder, marking as published, recording failures, and modifying schedules.
- Publishers can maintain unpublished content; administrators are additionally responsible for retracting published status and managing the publishing trash.
- Delivery packages are stored in the storage root directory under
output/publishing/{sourceJobId}/v{version}-{packageId}/. The storage root directory depends on the runtime mode: for desktop, it's~/Library/Application Support/douyin-ai-video/storage(macOS); for the standalone backend, it'sstorage/within the repo. - Delivery packages are self-contained: final videos, covers, and image/text images are all copied into the package directory. Therefore, deleting assets or altering source files after the fact does not affect an already-built package.
- Publication schedules are only checked while the application is running; tasks that expire while the application is closed will be processed on the next startup, but platforms will not be opened automatically.
- The publishing trash is separate from the task trash and retains items for 30 days. Cleanup only deletes local publishing assets, does not affect source works, other versions, or videos on the platform.
- If
cache/publishing-index.jsonis corrupted, publishing write operations enter read-only protection. Please back up the original file first, then restore from a valid backup or manually repair; the creative workflow can still be used.
Interface Preview
Main Interface - Task List & Collections
- Create a new task (URL / profile link / share text)
- Collection view: view all subtask progress aggregated by creator
- View all task statuses
- View currently executable steps or failed steps
- Delete task to in-app trash
Task Detail Page
- Overview — Basic task information and processing status
- Main Pipeline Steps — Download, extract audio, ASR transcription, AI rewriting, generate storyboards, generate video
- Video Transcription — The actual transcribed text extracted from the video audio
- AI Rewriting — Cleaned title, summary, core points, script, speaking script, and quality prompts
- Storyboard Content — Short video storyboards and video prompts generated from the rewritten content
- Final Video — HyperFrames locally rendered MP4, project path, and scene list
Collection Detail Page
- Top section: User info (nickname, avatar, total works) + 'Check for Updates' button
- Video list (thumbnail, description, status, checkbox), sorted by publish time descending
- Batch operations: create selected tasks, batch transcribe, batch rewrite, batch storyboard, batch generate videos
- Subtask overall progress bar
- View all transcription text + 'Generate Skill' button
Skill Management Page
- Card-style grid layout displaying all generated Skills
- Each card shows: Skill name, source collection, auto-sync status, transcription count, generation date
- Operations: view content (3 tabs: SKILL.md render, raw source, meta info JSON), reuse in collection page
- Supports inline rename, automatically syncs SKILL.md frontmatter and file directory
Publishing Center
- View pending, awaiting publication, scheduled, published, failed, asset anomalies, and publishing trash
- Filter by title/copy, platform, source task, version number, and creator
- Expand a delivery package to view copy per platform, schedule, asset health status, and audit records
- Execute operations: copy copy, preview, open platform, locate video, mark as published, record failure, cancel, restore, and create new version
- Image/text packages additionally offer 'Publish Image/Text to TikTok' (preview then submit) and 'Submit Verification Code'
- Article packages (Toutiao) additionally offer 'Submit to Toutiao Account' (preview then submit) and 'Download Article HTML' (fallback path: export
article.html, usable at any time, can be pasted directly into the Toutiao editor); article tasks do not offer 'Edit Copy' — the body is the rendered result of the package-levelarticle.html, to change it you must rebuild the article package
Settings Page
- AI Key Management — Manage multiple AI service API Keys, supports DeepSeek, OpenAI, and relay proxies
- TikTok Login — QR code login or manual cookie paste, view login status
- Toutiao — Toutiao account QR code login (in-app QR code / open browser window to scan) and 'Verify Login' zero-side-effect self-check
- Speech Recognition Status — Display built-in Whisper local transcription capability
Technical Architecture
┌─────────────────────────────────────────┐
│ Electron Main Process │
│ - Window management │
│ - IPC communication │
│ - Backend service startup │
└─────────────────────────────────────────┘
│ │
┌──────┘ └──────┐
▼ ▼
┌─────────────────┐ ┌──────────────────────┐
│ React Frontend │ HTTP │ Express Backend │
│ │ ◄────► │ │
│ - React 19 │ │ - Task management │
│ - Vite │ │ - User profile crawl │
│ - Zustand │ │ - Collection mgmt+inc│
│ - Tailwind CSS │ │ - Signature algo (a_b)│
│ - React Router │ │ - Cookie management │
│ │ │ - Video download │
│ │ │ - Audio extraction │
│ │ │ - Speech transcription│
│ │ │ - AI cleaning │
│ │ │ - Storyboard gen │
│ │ │ - Skill knowledge │
│ │ │ distillation │
│ │ │ - Toutiao article pub│
└─────────────────┘ └──────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────┐ ┌────────────┐
│ AI / Local ASR │ │ File Storage│
│ - DeepSeek │ │ │
│ - OpenAI │ │ ~/.douyin │
│ - Relay Proxy │ │ -ai-video/│
│ - whisper.cpp │ │ storage │
│ - ggml-small │ │ ~/.claude │
└─────────────────┘ │ /skills/ │
└────────────┘
Technology Stack
Backend
- Runtime: Node.js 18+
- Framework: Express 4
- Language: TypeScript 5.x
- Video Processing: yt-dlp, ffmpeg
- Browser Automation: Playwright (for user profile crawling and QR code login)
- AI Services: OpenAI SDK (compatible with DeepSeek / OpenAI-compatible)
- ASR: Built-in whisper.cpp + ggml-small (bundled with installer)
- Video Rendering: HyperFrames CLI (optional, video generation step requires Node.js 22+ and FFmpeg)
- Signature Algorithm: SM3/MD5 + RC4 + custom Base64 (pure TypeScript implementation)
Frontend
- Framework: React 19
- Build: Vite 6
- Routing: React Router DOM 7
- State Management: Zustand 5
- Styling: Tailwind CSS (custom design system)
Desktop
- Framework: Electron 34
- Packaging: electron-builder
Installation and Running
Prerequisites
- Node.js >= 18.0.0
- npm >= 9.0.0
- macOS or Windows
- Development mode requires locally available yt-dlp, ffmpeg, and Playwright browser
- Video generation step requires Node.js >= 22 and HyperFrames CLI
- The packaging command will automatically prepare the complete running resources; the build machine needs internet access,
tar,unzip, and basic command-line tools - The installer will bundle yt-dlp, ffmpeg, ffprobe, whisper.cpp, ggml-small, HyperFrames CLI, and Chrome headless shell
Installing Dependencies
# Clone the repository
git clone https://github.com/LiChangZheng10086/doyin_ai_video.git
cd doyin_ai_video
# Install dependencies
npm install
# Install Playwright browser (required for user profile crawling and QR code login)
npx playwright install chromium
Development Mode
# Start Vite + Electron in one go
npm run dev
# Or start separately
npm run dev:renderer
npm run dev:electron
Production Build
# Build macOS Apple Silicon DMG/ZIP
npm run package:mac
# Build Windows 11 x64 NSIS installer
npm run package:win
# Sequential build macOS + Windows
npm run package:all
The packaging script prepares vendor/package-assets for the target platform and copies the required runtime resources into the installer:
bin/: yt-dlp, ffmpeg, ffprobewhisper/: whisper-cli, ggml-small model, and Windows DLLshyperframes/: HyperFrames CLI and its Node dependenciesbrowser/: Chrome headless shell
Currently, package:mac generates a macOS arm64 package; package:win generates a Win11 x64 package. The installed application does not require the user to install Python, FunASR, Whisper, ffmpeg, yt-dlp, Node.js, or HyperFrames. TikTok downloading and AI rewriting still require network access; AI rewriting/Skill generation still require a valid AI API Key.
Configuration
1. AI API Configuration
Add an AI API Key in the application settings page:
DeepSeek (Recommended)
- API Key: https://platform.deepseek.com/api_keys
- Model: deepseek-chat
- Good value for money, suitable for Chinese content
OpenAI
- API Key: https://platform.openai.com/api-keys
- Model: gpt-4o, gpt-4o-mini
- Stable quality
Relay Proxy / Custom
- Supports any OpenAI-compatible API, just fill in the baseURL and model name
2. TikTok Cookie Configuration
To enable direct signature API calls and batch collection, you need to configure a TikTok login session in the settings page. Two methods are provided:
QR Code Login
- Open Settings → Douyin Login → Click 'Open Browser to Scan QR Code'
- Scan the QR code in the pop-up window to complete login
- Cookie is automatically saved to
~/.douyin-ai-video/douyin-cookie.txt
Manual Paste (Recommended)
- Open and login to https://www.douyin.com/ in Chrome
- Press F12 to open DevTools → Application → Cookies → douyin.com
- Copy all cookies in the format
key1=value1; key2=value2; ... - Paste into the input field on the settings page, click 'Save Cookie'
Key authentication cookies include: sessionid, sid_guard, passport_csrf_token, odin_tt, ttwid
3. Speech Transcription Configuration
Speech transcription is already bundled into the desktop application:
- Engine:
whisper.cpp - Model:
ggml-smallmultilingual model - Audio: ffmpeg extracts
pcm_s16le, 16kHz, mono WAV - Operation: Local transcription, no ASR API Key, Python, FunASR, or faster-whisper required
To prepare Whisper in development mode or separately:
npm run prepare:whisper
This command will generate:
vendor/whisper/
├── whisper-cli
└── models/
└── ggml-small.bin
Old configuration file entries like asrProvider, asrApiKey, asrBaseURL, asrModel will continue to be read for compatibility, but the backend transcription no longer uses them.
4. External Dependencies
Development mode will use the following system tools; the official installer already bundles equivalent resources:
-
yt-dlp — Video download
brew install yt-dlp # macOS -
ffmpeg — Audio/video processing
brew install ffmpeg # macOS -
HyperFrames — Local HTML animation rendering to MP4 (required for video generation step in development mode)
npx --yes [email protected] doctor
HyperFrames is a local HTML/CSS/GSAP to video rendering pipeline. It is not Sora, Remotion auto-generated videos, or the HeyGen cloud video generation API. In the development environment, the CLI is invoked by default via npx --yes [email protected]; after packaging, it prioritizes the bundled HyperFrames CLI and Chrome headless shell. Current v1 generates image/text explanation videos without real people or digital humans; voiceoverScript is used for subtitle and scene timing, and TTS voiceover is not automatically generated yet.
Browser for Toutiao Publishing: Reuses the above bundled Chrome headless shell, zero additional dependencies. If it cannot be resolved, choose one of the following as prompted:
npm run prepare:package:mac # Pull chrome-headless-shell from packaging resources
npx playwright install chromium # Or install a full one
Skill Usage
This skill is designed for AI agents like Claude Code, Cursor, and Codex. It leverages the DouChuang Workshop tool and its API to perform automated content processing and publishing tasks. The skill provides a structured workflow for:
- Content Acquisition: Download videos from TikTok via share links or user profile pages, with watermark-free options.
- Content Processing: Extract audio, transcribe using local Whisper, rewrite with AI, and generate video storyboards.
- Content Generation: Optionally generate local 9:16 MP4 videos using HyperFrames.
- Content Publishing: Prepare and submit content to TikTok (image/text) and Toutiao (articles) with robust validation and human-in-the-loop confirmation.