fetch-youtube-transcript
БесплатноБез исполняемых скриптовНе проверенDownload YouTube video transcripts as readable text files. Use when extracting transcripts from videos for analysis, documentation, or content review.
от jpoutrin★ 16 звёзд на GitHubОб этом скилле
YouTube Transcript Download Skill
Purpose
Download transcripts from YouTube videos as readable text files with timestamps. This skill wraps the youtube-transcript-api tool with a simple interface for quick transcript extraction.
Usage
/fetch-youtube-transcript <video-url-or-id> [--output DIR] [--language LANG]
Arguments
Required
<video-url-or-id>: YouTube video URL or video ID- Full URLs:
https://www.youtube.com/watch?v=VIDEO_ID - Short URLs:
https://youtu.be/VIDEO_ID - Video ID only:
VIDEO_ID(11 characters) - URLs with timestamps and query parameters are supported
- Full URLs:
Optional
--output DIR: Output directory for transcript files- Default:
.work/transcripts/ - Directory will be created if it doesn't exist
- Transcript saved as
VIDEO_ID.txt
- Default:
--language LANG: Preferred transcript language code- Default: Auto-select (usually English if available)
- Examples:
en,es,fr,de,ja - Falls back to auto-generated if manual transcript unavailable
Execution Instructions for Claude Code
When the user invokes /fetch-youtube-transcript, follow these steps:
1. Parse Arguments
Extract the video URL/ID and optional parameters from the user's command:
# Example argument parsing logic
import re
from pathlib import Path
def parse_args(args_string):
"""Parse /fetch-youtube-transcript arguments."""
parts = args_string.split()
if not parts:
return None, None, None, "Error: Video URL or ID required"
video_url = parts[0]
output_dir = ".work/transcripts"
language = None
# Parse optional flags
i = 1
while i < len(parts):
if parts[i] == "--output" and i + 1 < len(parts):
output_dir = parts[i + 1]
i += 2
elif parts[i] == "--language" and i + 1 < len(parts):
language = parts[i + 1]
i += 2
else:
i += 1
return video_url, output_dir, language, None
2. Construct Command
Build the uvx command to run the transcript fetcher:
uvx --from youtube-transcript-api \
python scripts/fetch-youtube-transcript.py \
"<video-url>" \
--output "<output-dir>"
If language is specified, add --language <lang>.
Important:
- The script is bundled with this plugin at
scripts/fetch-youtube-transcript.py - Quote the video URL to handle special characters
- Use the full path to the script in the plugin cache directory
3. Execute Command
Run the command using the Bash tool with appropriate error handling:
# Construct full command
cmd_parts = [
"uvx --from youtube-transcript-api",
"python scripts/fetch-youtube-transcript.py",
f'"{video_url}"',
f"--output {output_dir}"
]
if language:
cmd_parts.append(f"--language {language}")
command = " ".join(cmd_parts)
# Execute via Bash tool
# The script will handle all video ID extraction and error cases
4. Handle Output
The script outputs structured information on success:
✅ Transcript downloaded successfully!
Video: 4_2j5wgt_ds
File: .work/transcripts/4_2j5wgt_ds.txt
Entries: 851
Parse this output and report to the user:
- Confirm successful download
- Show the output file location
- Indicate the number of transcript entries
5. Handle Errors
The script returns non-zero exit codes and error messages for failures:
Common error scenarios:
Invalid URL format
❌ Error: Invalid YouTube URL or video IDReport: "The provided URL or video ID is invalid. Please provide a valid YouTube URL or 11-character video ID."
No transcript available
❌ Error: No transcript found for video Could not retrieve a transcript for the video IDReport: "No transcript is available for this video. The creator may have disabled transcripts."
Video unavailable
❌ Error: Video unavailable or privateReport: "The video is unavailable, private, or has been deleted."
Network errors
❌ Error: Network request failedReport: "Failed to connect to YouTube. Please check your internet connection."
Invalid output directory
❌ Error: Cannot create output directoryReport: "Failed to create output directory. Please check permissions."
6. Report Success
On successful execution, provide a clear summary:
✅ Transcript downloaded successfully!
📹 Video ID: 4_2j5wgt_ds
📄 File: .work/transcripts/4_2j5wgt_ds.txt
📊 Entries: 851 transcript segments
You can now read the transcript file or use it for analysis.
Output Format
Transcripts are saved as plain text files with the following format:
[00:00] Welcome to this video about Product Forge!
[00:15] Today we'll be exploring how to build custom Claude Code plugins.
[00:32] First, let's talk about the plugin architecture.
...
Each line contains:
- Timestamp:
[MM:SS]format for easy navigation
Установить fetch-youtube-transcript в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл fetch-youtube-transcript?
Download YouTube video transcripts as readable text files. Use when extracting transcripts from videos for analysis, documentation, or content review.
Как установить скилл fetch-youtube-transcript?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fetch-youtube-transcript запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic