$npx -y skills add ImGoodBai/goodable --skill good-TTvideo2textExtract audio from short videos (Douyin/TikTok) and transcribe to text with timestamps. Use when user provides video URL and needs audio transcription.
| 1 | # good-TTvideo2text |
| 2 | |
| 3 | Extract audio from Douyin/TikTok videos and transcribe to text using ASR service. |
| 4 | |
| 5 | ## Task Objective |
| 6 | |
| 7 | Convert Douyin/TikTok video audio to text with timestamps, supporting both interactive UI and command-line workflow. |
| 8 | |
| 9 | **Capabilities:** Video parsing, audio extraction, ASR transcription, timestamp generation |
| 10 | |
| 11 | **Trigger:** User provides Douyin/TikTok URL and requests transcription |
| 12 | |
| 13 | ## Usage Modes |
| 14 | |
| 15 | ### Mode 1: Web UI (Recommended) |
| 16 | |
| 17 | Visual interface for transcription management: |
| 18 | |
| 19 | ```bash |
| 20 | # Install dependencies |
| 21 | cd skills/good-TTvideo2text |
| 22 | pip install -r requirements.txt |
| 23 | |
| 24 | # Start service (default port 8000) |
| 25 | python app/main.py |
| 26 | |
| 27 | # Browser access |
| 28 | http://localhost:8000 |
| 29 | ``` |
| 30 | |
| 31 | **Features:** |
| 32 | - Paste video URL for instant transcription |
| 33 | - View results with timestamps |
| 34 | - Cookie management for restricted videos |
| 35 | - Real-time progress updates |
| 36 | |
| 37 | ### Mode 2: Script (Command Line) |
| 38 | |
| 39 | Suitable for automation, AI workflow integration: |
| 40 | |
| 41 | ```bash |
| 42 | # Basic usage |
| 43 | python scripts/transcribe.py "https://v.douyin.com/xxx" |
| 44 | |
| 45 | # Extract URL from share text |
| 46 | python scripts/transcribe.py "7.47 复制打开抖音,看看【用户名】的作品 https://v.douyin.com/xxx" |
| 47 | |
| 48 | # JSON output |
| 49 | python scripts/transcribe.py "https://v.douyin.com/xxx" --output json |
| 50 | |
| 51 | # Text output (default) |
| 52 | python scripts/transcribe.py "https://v.douyin.com/xxx" --output text |
| 53 | ``` |
| 54 | |
| 55 | **Output Format (Text):** |
| 56 | ``` |
| 57 | === Video Info === |
| 58 | Title: Video title |
| 59 | Author: Author name |
| 60 | Duration: 30s |
| 61 | |
| 62 | === Transcription === |
| 63 | Full Text: |
| 64 | Complete transcription text... |
| 65 | |
| 66 | Sentences with Timestamps: |
| 67 | [00:00-00:03] First sentence |
| 68 | [00:03-00:06] Second sentence |
| 69 | ``` |
| 70 | |
| 71 | **Output Format (JSON):** |
| 72 | ```json |
| 73 | { |
| 74 | "success": true, |
| 75 | "video_info": { |
| 76 | "title": "Video title", |
| 77 | "author": "Author name", |
| 78 | "duration": 30, |
| 79 | "create_time": 1234567890 |
| 80 | }, |
| 81 | "transcription": { |
| 82 | "text": "Complete transcription...", |
| 83 | "sentences": [ |
| 84 | { |
| 85 | "start_ms": 0, |
| 86 | "end_ms": 3000, |
| 87 | "text": "First sentence" |
| 88 | } |
| 89 | ] |
| 90 | } |
| 91 | } |
| 92 | ``` |
| 93 | |
| 94 | ## Prerequisites |
| 95 | |
| 96 | **Dependencies:** |
| 97 | - fastapi>=0.120.3, uvicorn>=0.35.0, httpx>=0.28.1 |
| 98 | - TikTokDownloader dependencies (see requirements.txt) |
| 99 | |
| 100 | **ASR Configuration:** |
| 101 | - Environment variables auto-injected by Goodable platform |
| 102 | - `GOODABLE_ASR_SUBMIT_URL` - ASR task submission endpoint |
| 103 | - `GOODABLE_ASR_QUERY_URL_TEMPLATE` - ASR result query endpoint (with {task_id} placeholder) |
| 104 | |
| 105 | **Cookie Configuration (Optional):** |
| 106 | - Some videos require login cookies |
| 107 | - Configure via Web UI Settings or edit `TikTokDownloader/settings.json` |
| 108 | - Cookie format: Douyin web cookie string |
| 109 | |
| 110 | ## Standard Workflow (AI Usage) |
| 111 | |
| 112 | ### When User Provides URL |
| 113 | |
| 114 | 1. **Extract URL from input:** |
| 115 | - User may provide raw URL or share text with URL |
| 116 | - Use regex to extract actual video URL |
| 117 | |
| 118 | 2. **Call transcribe script:** |
| 119 | ```bash |
| 120 | python scripts/transcribe.py "USER_PROVIDED_TEXT" |
| 121 | ``` |
| 122 | |
| 123 | 3. **Handle results:** |
| 124 | - Success: Present transcription text and timestamps |
| 125 | - Error: Check error message for troubleshooting |
| 126 | |
| 127 | ### Common Error Handling |
| 128 | |
| 129 | | Error | Cause | Solution | |
| 130 | |-------|-------|----------| |
| 131 | | Invalid video URL | URL format incorrect | Ask user to provide valid Douyin/TikTok URL | |
| 132 | | Video not found | Video deleted or requires login | Ask user to check video or provide cookies | |
| 133 | | No audio found | Video has no background music | Inform user this video has no audio track | |
| 134 | | ASR not configured | Environment variables missing | Run via Goodable platform (auto-injects vars) | |
| 135 | | ASR timeout | Long audio or service slow | Retry or use Web UI for monitoring | |
| 136 | |
| 137 | ## Resource Index |
| 138 | |
| 139 | - `app/main.py` - FastAPI application entry |
| 140 | - `scripts/transcribe.py` - Command-line transcription script |
| 141 | - `TikTokDownloader/` - Video parsing library (source code) |
| 142 | - `TikTokDownloader/settings.json` - Cookie and configuration |
| 143 | - `static/index.html` - Web UI interface |
| 144 | - `requirements.txt` - Python dependencies |
| 145 | - `downloads/` - Temporary file directory |
| 146 | |
| 147 | ## Important Notes |
| 148 | |
| 149 | 1. **Cookie Requirement:** Public videos work without cookies, restricted videos need login cookies |
| 150 | 2. **ASR Platform:** This skill requires Goodable platform's ASR service integration |
| 151 | 3. **URL Formats Supported:** |
| 152 | - Short URL: `https://v.douyin.com/xxx` |
| 153 | - Full URL: `https://www.douyin.com/video/1234567890` |
| 154 | - TikTok: `https://vm.tiktok.com/xxx`, `https://www.tiktok.com/@user/video/xxx` |
| 155 | 4. **Audio Extraction:** Extracts background music URL directly (no download needed) |
| 156 | 5. **ASR Processing Time:** Typically 5-30 seconds depending on audio length |
| 157 | |
| 158 | ## Example AI Usage |
| 159 | |
| 160 | ```markdown |
| 161 | User: "帮我转写这个抖音视频 7.47 复制打开抖音 https://v.douyin.com/abc123" |
| 162 | |
| 163 | AI: Let me transcribe this video for you. |
| 164 | |
| 165 | [Calls transcribe.py script with the provided text] |
| 166 | |
| 167 | Based on the transcription: |
| 168 | |
| 169 | Video: "视频标题" |
| 170 | Author: 作者名 |
| 171 | |
| 172 | Transcription: |
| 173 | [00:00-00:03] 第一句话内容 |
| 174 | [00:03-00:08] 第二句话内容 |
| 175 | ... |
| 176 | |
| 177 | Full |