| 1 | --- |
| 2 | name: extracting-thumbnails |
| 3 | description: Extracts thumbnails from video URLs. Use when publishing video content that requires a cover image, when the user does not provide a cover/thumbnail, or before publishing to platforms that require cover images (Kwai, Bilibili, YouTube). 提取封面、视频封面、生成封面、缩略图提取、视频缩略图、截取封面。 |
| 4 | --- |
| 5 | |
| 6 | # Thumbnail Extraction |
| 7 | |
| 8 | Extracts thumbnails from video URLs for use as cover images. |
| 9 | |
| 10 | ## When to Use |
| 11 | |
| 12 | Use this skill when: |
| 13 | |
| 14 | - Publishing video content that requires a cover image |
| 15 | - User doesn't provide a cover/thumbnail for video content |
| 16 | - Before publishing to platforms that require cover images (Kwai, Bilibili) |
| 17 | |
| 18 | ## Platform Cover Requirements |
| 19 | |
| 20 | | Platform | Cover Required | Notes | |
| 21 | | -------- | -------------- | -------------------------------- | |
| 22 | | Kwai | Yes | Mandatory for all videos | |
| 23 | | Bilibili | Recommended | Improves click-through rate | |
| 24 | | YouTube | Recommended | Custom thumbnails increase views | |
| 25 | | TikTok | Optional | Auto-generated if not provided | |
| 26 | | Facebook | Optional | Recommended for better display | |
| 27 | |
| 28 | ## Workflow |
| 29 | |
| 30 | ### Step 1: Check if Thumbnail Needed |
| 31 | |
| 32 | Determine if the target platform requires a cover image. |
| 33 | |
| 34 | ### Step 2: Submit Extraction Task |
| 35 | |
| 36 | Call `createThumbnailTask` with video URL. |
| 37 | |
| 38 | ### Step 3: Poll for Results |
| 39 | |
| 40 | 1. First check: Wait **15 seconds** after submission |
| 41 | 2. Subsequent checks: Wait **10 seconds** between polls |
| 42 | 3. Call `getThumbnailTaskStatus` to check progress |
| 43 | |
| 44 | ### Step 4: Return Results |
| 45 | |
| 46 | On success, return the thumbnail URL for use as coverUrl. |
| 47 | |
| 48 | ## Examples |
| 49 | |
| 50 | ### Example 1: Extract for Publishing |
| 51 | |
| 52 | **User wants to publish video to Kwai without cover** |
| 53 | |
| 54 | ``` |
| 55 | 1. createThumbnailTask: |
| 56 | - url: "https://example.com/video.mp4" |
| 57 | 2. Wait 15 seconds |
| 58 | 3. Poll getThumbnailTaskStatus until success |
| 59 | 4. Use returned thumbnail URL as coverUrl |
| 60 | 5. Proceed with createChannelPublishFlow |
| 61 | ``` |
| 62 | |
| 63 | ### Example 2: Generate Cover Before Publishing |
| 64 | |
| 65 | ``` |
| 66 | 1. User provides video URL, title, description |
| 67 | 2. Check if coverUrl is provided |
| 68 | 3. If no coverUrl: |
| 69 | a. createThumbnailTask with videoUrl |
| 70 | b. Poll getThumbnailTaskStatus |
| 71 | c. Use returned thumbnail as coverUrl |
| 72 | 4. Proceed with publishing |
| 73 | ``` |
| 74 | |
| 75 | ## Task Status Values |
| 76 | |
| 77 | | Status | Description | |
| 78 | | ---------- | ------------------------------------- | |
| 79 | | pending | Task created, waiting to start | |
| 80 | | processing | Task is actively extracting thumbnail | |
| 81 | | success | Thumbnail extracted successfully | |
| 82 | | failed | Task failed with error | |
| 83 | |
| 84 | ## Important Notes |
| 85 | |
| 86 | - Thumbnail extraction typically takes 10-15 seconds |
| 87 | - Always generate thumbnails for platforms that require covers (Kwai) |
| 88 | - Handle failures gracefully - inform user or use platform default |
| 89 | - Generated thumbnails can be used directly as coverUrl in publish tools |
| 90 |