Skip to content
Back to skills

Youtube Text Fetch

ASecurity

Fetch transcript/caption text from YouTube videos using youtube-transcript-api. Use when: (1) User wants text from a YouTube video, (2) User provides YouTube URLs and needs transcripts, (3) User says 'fetch youtube text', 'get captions', 'youtube transcript'. Outputs plain text saved to the repo-scoped cclogs dir (resolved via get-logdir.js) as youtube-{VIDEO_ID}.txt.

  • 12 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
businesspythonbashnodedebuggingapi

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 8, 2026

npx -y skills add Takazudo/claude-resources --skill youtube-text-fetch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Youtube Text Fetch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Youtube Text Fetch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/takazudo-youtube-text-fetch/badge)](https://www.skillsdirectory.com/skills/takazudo-youtube-text-fetch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: youtube-text-fetch
description: "Fetch transcript/caption text from YouTube videos using youtube-transcript-api. Use when: (1) User wants text from a YouTube video, (2) User provides YouTube URLs and needs transcripts, (3) User says 'fetch youtube text', 'get captions', 'youtube transcript'. Outputs plain text saved to the repo-scoped cclogs dir (resolved via get-logdir.js) as youtube-{VIDEO_ID}.txt."
user-invocable: true
argument-hint: "YouTube URL(s) — space-separated if multiple. Optional flags: --timestamps (include timestamps in output)"
---

# YouTube Text Fetch

Fetch transcript/caption text from YouTube videos.

**Note**: For visual analysis of a YouTube video (extracting frames and reading them
chronologically with vision to produce a timestamped narrative, e.g. debugging a
recording or answering "what happens in this video"), use the `/video-reader` skill
instead. This skill is for quick transcript-only extraction.

## Prerequisites

Requires `youtube-transcript-api` Python package:

```bash
pip3 install youtube-transcript-api
```

If not installed, install it automatically before proceeding.

## Workflow

### 1. Parse Video IDs

Extract video IDs from provided URLs. Supported formats:

- `https://youtu.be/<ID>`
- `https://youtu.be/<ID>?si=...`
- `https://www.youtube.com/watch?v=<ID>`
- `https://youtube.com/watch?v=<ID>&...`

Check if `--timestamps` flag is present (include timestamps in output).

### 2. Fetch Transcripts

For each video ID, run:

**With timestamps** (default when `--timestamps` flag is used, or when writing guide articles):

```bash
python3 -c "
from youtube_transcript_api import YouTubeTranscriptApi
snippets = YouTubeTranscriptApi().fetch('VIDEO_ID')
for s in snippets:
    minutes = int(s.start // 60)
    seconds = int(s.start % 60)
    print(f'[{minutes:02d}:{seconds:02d}] {s.text}')
"
```

**Plain text** (default):

```bash
python3 -c "
from youtube_transcript_api import YouTubeTranscriptApi
snippets = YouTubeTranscriptApi().fetch('VIDEO_ID')
for s in snippets:
    print(s.text)
"
```

If the default language fails, try fetching with specific language codes:

```bash
python3 -c "
from youtube_transcript_api import YouTubeTranscriptApi
snippets = YouTubeTranscriptApi().fetch('VIDEO_ID', languages=['en', 'ja'])
for s in snippets:
    print(s.text)
"
```

### 3. Save Output

Determine the log directory first:

```bash
LOGDIR=$(node $HOME/.claude/scripts/get-logdir.js)
mkdir -p "$LOGDIR"
```

Save each transcript to `$LOGDIR/youtube-<VIDEO_ID>.txt`.

If multiple videos are provided, also create a combined file `$LOGDIR/youtube-combined.txt` with clear separators between each video's transcript.

### 4. Report

Print a summary of what was fetched:

- Video ID
- Language detected
- Approximate word/character count
- Output file path

## Alternative: yt-tools Sub-Package

If the project has the `sub-packages/yt-tools/` sub-package, it provides a more
comprehensive workflow including video download and frame capture:

```bash
cd sub-packages/yt-tools
pnpm download <youtube-url>        # Downloads video + metadata + transcript
pnpm capture:auto <video-id>       # Auto-captures frames at intervals
```

Use yt-tools when you need the full video processing pipeline (download, capture,
transcript). Use this skill (`/youtube-text-fetch`) when you only need the transcript
text.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.