一键导入
cobalt-downloader
Download YouTube videos using Cobalt API (self-hosted or public). No cookies required, more reliable than direct yt-dlp.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Download YouTube videos using Cobalt API (self-hosted or public). No cookies required, more reliable than direct yt-dlp.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Calculate Four Pillars (四柱) from birth date/time using lunar calendar conversion. Foundation skill for all BaZi analysis.
Create and manage artifact.json for task outputs. Use when creating code files, documentation, or any files that should be tracked as artifacts.
Create and manage artifact.json for task outputs. Use at the START of every task to define planned deliverables before beginning research.
Provide career guidance and recommendations based on BaZi elemental strengths, Day Master traits, and current luck cycles.
Calculate and interpret 10-year luck cycles (大运) and annual fortune (流年) for timing insights and life trend predictions.
Analyze BaZi compatibility for romantic relationships (合婚). Examines elemental harmony, Day Master interaction, and long-term compatibility potential.
| name | cobalt-downloader |
| description | Download YouTube videos using Cobalt API (self-hosted or public). No cookies required, more reliable than direct yt-dlp. |
This skill uses Cobalt API to download YouTube videos. Cobalt is an open-source media downloader that handles YouTube's anti-bot measures.
Use the public Cobalt instance (rate limited):
COBALT_API="https://api.cobalt.tools"
Deploy your own Cobalt instance:
# Docker deployment
docker run -d -p 9000:9000 ghcr.io/imputnet/cobalt:latest
# Set API endpoint
COBALT_API="http://localhost:9000"
# Set Cobalt API endpoint
COBALT_API="${COBALT_API:-https://api.cobalt.tools}"
echo "Using Cobalt API: $COBALT_API"
# Create output directories
mkdir -p ./output/downloads ./temp
VIDEO_URL="[YOUTUBE_URL]"
# Request download link from Cobalt
RESPONSE=$(curl -s -X POST "$COBALT_API/api/json" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "{
\"url\": \"$VIDEO_URL\",
\"vCodec\": \"h264\",
\"vQuality\": \"1080\",
\"aFormat\": \"mp3\",
\"filenamePattern\": \"basic\"
}")
echo "$RESPONSE" | python3 -c "
import sys, json
data = json.load(sys.stdin)
if data.get('status') == 'stream' or data.get('status') == 'redirect':
print('DOWNLOAD_URL=' + data.get('url', ''))
elif data.get('status') == 'picker':
# Multiple streams available
print('DOWNLOAD_URL=' + data['picker'][0]['url'])
else:
print('ERROR=' + data.get('text', 'Unknown error'))
"
# Extract video ID from URL
VIDEO_ID=$(echo "$VIDEO_URL" | grep -oP 'v=\K[^&]+' || echo "$VIDEO_URL" | grep -oP 'youtu\.be/\K[^?]+')
# Download using the obtained URL
if [ -n "$DOWNLOAD_URL" ]; then
curl -L -o "./output/downloads/${VIDEO_ID}.mp4" "$DOWNLOAD_URL"
echo "✅ Downloaded to ./output/downloads/${VIDEO_ID}.mp4"
else
echo "❌ Failed to get download URL: $ERROR"
fi
# Request audio only
RESPONSE=$(curl -s -X POST "$COBALT_API/api/json" \
-H "Content-Type: application/json" \
-d "{
\"url\": \"$VIDEO_URL\",
\"isAudioOnly\": true,
\"aFormat\": \"mp3\"
}")
# Download audio
AUDIO_URL=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('url',''))")
curl -L -o "./output/downloads/${VIDEO_ID}.mp3" "$AUDIO_URL"
| Parameter | Type | Description |
|---|---|---|
url | string | YouTube video URL |
vCodec | string | Video codec: h264, av1, vp9 |
vQuality | string | Quality: 144-2160, max |
aFormat | string | Audio format: mp3, ogg, wav, opus |
isAudioOnly | boolean | Download audio only |
filenamePattern | string | basic, pretty, nerdy |
| Status | Description |
|---|---|
stream | Direct download URL |
redirect | Redirect to download |
picker | Multiple options available |
error | Error occurred |
For production use, self-host Cobalt:
version: '3.8'
services:
cobalt-api:
image: ghcr.io/imputnet/cobalt:latest
container_name: cobalt
restart: unless-stopped
ports:
- "9000:9000"
environment:
- API_URL=http://your-domain:9000
- API_NAME=cobalt
| Error | Solution |
|---|---|
rate-limit | Self-host or wait |
content.video.unavailable | Video is private/deleted |
content.video.live | Cannot download live streams |
fetch.fail | Network issue, retry |
If Cobalt fails, fall back to yt-dlp:
if [ -n "$ERROR" ]; then
echo "Cobalt failed, trying yt-dlp..."
yt-dlp --cookies ./config/cookies.txt -o "./output/downloads/%(id)s.%(ext)s" "$VIDEO_URL"
fi
| Feature | Cobalt API | yt-dlp |
|---|---|---|
| Cookies required | ❌ No | ✅ Yes (usually) |
| Rate limits | Per instance | Per IP |
| Self-hostable | ✅ Yes | N/A |
| Reliability | High | Variable |
| Speed | Fast | Medium |
| Customization | Limited | Extensive |