Loading...
Loading...
Compare original and translation side by side
Send a video/podcast link → get full transcript + structured summary
发送视频/播客链接 → 获取完整转录稿 + 结构化摘要
| Platform | Type | Subtitles | Whisper Transcription |
|---|---|---|---|
| YouTube | Video | ✅ | ✅ |
| Bilibili | Video | ✅ | ✅ |
| X/Twitter | Video | ❌ | ✅ |
| Xiaoyuzhou (小宇宙) | Podcast | ❌ | ✅ |
| Apple Podcasts | Podcast | ❌ | ✅ |
| Direct links (mp3/mp4/m3u8) | Any | ❌ | ✅ |
| 平台 | 类型 | 字幕支持 | Whisper转录支持 |
|---|---|---|---|
| YouTube | 视频 | ✅ | ✅ |
| Bilibili | 视频 | ✅ | ✅ |
| X/Twitter | 视频 | ❌ | ✅ |
| 小宇宙 (Xiaoyuzhou) | 播客 | ❌ | ✅ |
| Apple Podcasts | 播客 | ❌ | ✅ |
| 直链 (mp3/mp4/m3u8) | 任意 | ❌ | ✅ |
youtube.comyoutu.bebilibili.comb23.tvx.comtwitter.comxiaoyuzhoufm.compodcasts.apple.com.mp3.mp4.m3u8.m4a.webmyoutube.comyoutu.bebilibili.comb23.tvx.comtwitter.comxiaoyuzhoufm.compodcasts.apple.com.mp3.mp4.m3u8.m4a.webm| URL Pattern | Type | Pipeline |
|---|---|---|
| Podcast | → Step 1b (Xiaoyuzhou) |
| Podcast | → Step 1c (Apple) |
| Video | → Step 1d (Bilibili API) |
| Audio | → Step 2b (direct download) |
| Other | Video | → Step 1a (subtitle extraction) |
| URL匹配规则 | 类型 | 后续流程 |
|---|---|---|
| 播客 → 步骤1b(小宇宙处理) | |
| 播客 → 步骤1c(Apple播客处理) | |
| 视频 → 步骤1d(Bilibili API处理) | |
| 音频 → 步骤2b(直接下载) | |
| 其他 | 视频 → 步骤1a(字幕提取) |
rm -f /tmp/media_sub*.vtt /tmp/media_audio.mp3 /tmp/media_transcript*.json /tmp/media_segment_*.mp3 2>/dev/null || truerm -f /tmp/media_sub*.vtt /tmp/media_audio.mp3 /tmp/media_transcript*.json /tmp/media_segment_*.mp3 2>/dev/null || true
Check for subtitles:
```bash
ls /tmp/media_sub*.vtt 2>/dev/null
检查字幕是否存在:
```bash
ls /tmp/media_sub*.vtt 2>/dev/nullAUDIO_URL=$(curl -sL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36" \
"EPISODE_URL" \
| grep -oE 'https://media\.xyzcdn\.net/[^"]+\.(m4a|mp3)' \
| head -1)
echo "Audio URL: $AUDIO_URL"
curl -L -o /tmp/media_audio.mp3 "$AUDIO_URL"AUDIO_URL=$(curl -sL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36" \
"EPISODE_URL" \
| grep -oE 'https://media\.xyzcdn\.net/[^"]+\.(m4a|mp3)' \
| head -1)
echo "Audio URL: $AUDIO_URL"
curl -L -o /tmp/media_audio.mp3 "$AUDIO_URL"yt-dlp -f "ba[ext=m4a]/ba/b" --extract-audio --audio-format mp3 --audio-quality 5 \
-o "/tmp/media_audio.%(ext)s" "APPLE_PODCAST_URL"yt-dlp -f "ba[ext=m4a]/ba/b" --extract-audio --audio-format mp3 --audio-quality 5 \
-o "/tmp/media_audio.%(ext)s" "APPLE_PODCAST_URL"BV="BV1xxxxx"
curl -s "https://api.bilibili.com/x/web-interface/view?bvid=$BV" \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.bilibili.com/" \
| python3 -c "import json,sys; d=json.load(sys.stdin)['data']; print(f\"Title: {d['title']}\nDuration: {d['duration']}s\nCID: {d['cid']}\")"
CID=<CID from previous step>
AUDIO_URL=$(curl -s "https://api.bilibili.com/x/player/playurl?bvid=$BV&cid=$CID&fnval=16&qn=64" \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.bilibili.com/" \
| python3 -c "import json,sys; print(json.load(sys.stdin)['data']['dash']['audio'][0]['baseUrl'])")
curl -L -o /tmp/media_audio.m4s \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.bilibili.com/" "$AUDIO_URL"
ffmpeg -y -i /tmp/media_audio.m4s -acodec libmp3lame -q:a 5 /tmp/media_audio.mp3BV="BV1xxxxx"
curl -s "https://api.bilibili.com/x/web-interface/view?bvid=$BV" \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.bilibili.com/" \
| python3 -c "import json,sys; d=json.load(sys.stdin)['data']; print(f\"Title: {d['title']}\nDuration: {d['duration']}s\nCID: {d['cid']}\")"
CID=<CID from previous step>
AUDIO_URL=$(curl -s "https://api.bilibili.com/x/player/playurl?bvid=$BV&cid=$CID&fnval=16&qn=64" \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.bilibili.com/" \
| python3 -c "import json,sys; print(json.load(sys.stdin)['data']['dash']['audio'][0]['baseUrl'])")
curl -L -o /tmp/media_audio.m4s \
-H "User-Agent: Mozilla/5.0" -H "Referer: https://www.bilibili.com/" "$AUDIO_URL"
ffmpeg -y -i /tmp/media_audio.m4s -acodec libmp3lame -q:a 5 /tmp/media_audio.mp3yt-dlp --cookies-from-browser chrome -f "ba[ext=m4a]/ba/b" --extract-audio --audio-format mp3 --audio-quality 5 \
-o "/tmp/media_audio.%(ext)s" "VIDEO_URL"yt-dlp --cookies-from-browser chrome -f "ba[ext=m4a]/ba/b" --extract-audio --audio-format mp3 --audio-quality 5 \
-o "/tmp/media_audio.%(ext)s" "VIDEO_URL"FILE_SIZE=$(stat -f%z /tmp/media_audio.* 2>/dev/null || stat -c%s /tmp/media_audio.* 2>/dev/null)
echo "File size: $FILE_SIZE bytes"DURATION=$(ffprobe -v error -show_entries format=duration -of csv=p=0 /tmp/media_audio.* | head -1)
SEGMENT_SEC=600
SEGMENTS=$(python3 -c "import math; print(math.ceil(float('$DURATION')/$SEGMENT_SEC))")
for i in $(seq 0 $((SEGMENTS-1))); do
START=$((i * SEGMENT_SEC))
ffmpeg -y -i /tmp/media_audio.* -ss $START -t $SEGMENT_SEC -acodec libmp3lame -q:a 5 \
"/tmp/media_segment_${i}.mp3" 2>/dev/null
doneFILE_SIZE=$(stat -f%z /tmp/media_audio.* 2>/dev/null || stat -c%s /tmp/media_audio.* 2>/dev/null)
echo "File size: $FILE_SIZE bytes"DURATION=$(ffprobe -v error -show_entries format=duration -of csv=p=0 /tmp/media_audio.* | head -1)
SEGMENT_SEC=600
SEGMENTS=$(python3 -c "import math; print(math.ceil(float('$DURATION')/$SEGMENT_SEC))")
for i in $(seq 0 $((SEGMENTS-1))); do
START=$((i * SEGMENT_SEC))
ffmpeg -y -i /tmp/media_audio.* -ss $START -t $SEGMENT_SEC -acodec libmp3lame -q:a 5 \
"/tmp/media_segment_${i}.mp3" 2>/dev/null
doneGROQ_API_KEYif [ -z "$GROQ_API_KEY" ]; then
echo "❌ GROQ_API_KEY not set. Get one at: https://console.groq.com/keys"
exit 1
fi
curl -s -X POST "https://api.groq.com/openai/v1/audio/transcriptions" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@AUDIO_FILE" \
-F "model=whisper-large-v3-turbo" \
-F "response_format=verbose_json" \
-F "language=zh" \
> /tmp/media_transcript.json
python3 -c "import json; print(json.load(open('/tmp/media_transcript.json'))['text'])"GROQ_API_KEYif [ -z "$GROQ_API_KEY" ]; then
echo "❌ GROQ_API_KEY not set. Get one at: https://console.groq.com/keys"
exit 1
fi
curl -s -X POST "https://api.groq.com/openai/v1/audio/transcriptions" \
-H "Authorization: Bearer $GROQ_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@AUDIO_FILE" \
-F "model=whisper-large-v3-turbo" \
-F "response_format=verbose_json" \
-F "language=zh" \
> /tmp/media_transcript.json
python3 -c "import json; print(json.load(open('/tmp/media_transcript.json'))['text'])"| Situation | Action |
|---|---|
| No subtitles + no GROQ_API_KEY | Prompt user to set API key |
| Audio >25MB | ffmpeg segment (10min/segment), transcribe sequentially |
| Podcast >2 hours | Warn user, confirm before proceeding |
| Groq 524 timeout | Do NOT parallelize — transcribe sequentially, sleep 5-8s between |
| Groq 429 rate limit | Wait for retry-after header, then retry |
| yt-dlp Bilibili 412 | Use Bilibili API instead (Step 1d) |
| yt-dlp YouTube bot detection | Add |
| Spotify links | Not supported (DRM protected) |
| 场景 | 处理方案 |
|---|---|
| 无字幕 + 未设置GROQ_API_KEY | 提示用户设置API密钥 |
| 音频大小>25MB | 使用ffmpeg分片(每片10分钟),按顺序转录 |
| 播客时长>2小时 | 警告用户,确认后再继续处理 |
| Groq返回524超时 | 不要并行处理——按顺序转录,两次请求间隔5-8秒 |
| Groq返回429限流 | 等待retry-after头指定的时间后重试 |
| yt-dlp请求Bilibili返回412 | 改用Bilibili API处理(步骤1d) |
| yt-dlp请求YouTube被反爬拦截 | 增加 |
| Spotify链接 | 不支持(受DRM保护) |
yt-dlpffmpegcurlGROQ_API_KEYyt-dlpffmpegcurlGROQ_API_KEY