360 Secure SkillHub
360 安全技能中心

YouTube Transcript Fetcher

通过命令行抓取 YouTube 视频字幕并输出完整转写文本:支持单个视频 URL、频道近期视频加时间范围参数,以及基于 JSON 配置的批量/每日模式。实现上先用观看页抓取,再用 InnerTube 播放器 API 多客户端画像回退,以恢复仅存在自动生成字幕的情况。该 Skill 刻意保持 transcript-first,不做摘要。

ioridev
ioridev
热度 55.20
最近更新 2026-05-11 17:41:32
分类:数据依赖:代码执行 / 第三方 API / 读写文件应用场景:数据处理 / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add youtube-transcript-fetcher
Metadata
name
youtube-transcript-fetcher
description
Fetch full YouTube transcripts with robust InnerTube fallback. Use when extracting captions/transcripts from a YouTube URL, channel, or batch config, especially when normal transcript tools fail, uploader subtitles are missing, or YouTube auto-generated captions may still be recoverable.
metadata
{"openclaw":{"requires":{"bins":["python3","yt-dlp"]},"install":[{"id":"apt-yt-dlp","kind":"apt","package":"yt-dlp","bins":["yt-dlp"],"label":"Install yt-dlp (apt)"},{"id":"brew-yt-dlp","kind":"brew","formula":"yt-dlp","bins":["yt-dlp"],"label":"Install yt-dlp (brew)"}]}}

Fetch transcripts from YouTube videos. Prefer this skill when the goal is to obtain source transcript text, not to summarize.

Run ./youtube-transcript-fetcher --url <youtube-url> for a single video. Run ./youtube-transcript-fetcher --channel <channel-id-or-handle> --hours <n> for recent channel videos. Run ./youtube-transcript-fetcher --config config/channels.example.json --daily for batch mode.

The main script is scripts/youtube_transcript_fetcher.py. It uses watch-page scraping plus InnerTube player API fallback with multiple client profiles (ANDROID, WEB, TVHTML5_SIMPLY_EMBEDDED_PLAYER, IOS) to recover caption tracks that simpler methods miss, including cases where only YouTube auto-generated captions are available.

Install Python dependencies with pip install -r requirements.txt before first use.

Return the transcript text from the generated JSON output. Do not rely on summary fields because this skill is intentionally transcript-first.