DEV Community

Nidhi
Nidhi

Posted on

Feed a whole YouTube playlist into Claude or ChatGPT as one file (+ MCP setup)

Paste a YouTube link into Claude and ask for a summary, and one of three things happens: it tells you it can't open the link, it searches the web and summarizes what other people wrote about the video, or it quietly guesses from the title. None of those is the video.

What every assistant can do is read text. So the reliable workflow is:

  1. Get the captions as text.
  2. For a playlist, put all of them in one file in order, with a heading per video.
  3. Upload that file, or connect a transcript tool over MCP so the assistant fetches it on its own.

This post covers both, with the free DIY route first.

How much fits? (do this maths before uploading)

Speech runs at roughly 130–160 words a minute, so one hour of video is about 8,000–10,000 words, or roughly 11,000–13,000 tokens for English. Rough guide:

Playlist Approx. words Approx. tokens
10 × 15-min videos 20k 27k
20 × 1-hour lectures 180k 240k
100 × 1-hour lectures 900k 1.2M

Context limits differ by model and plan and change often, so check yours. Two practical rules:

  • Under your model's context limit: upload the single file and ask questions across the whole playlist.
  • Over it: upload to a Claude Project or a ChatGPT Project / custom GPT as knowledge files. Those retrieve the relevant parts instead of reading everything at once, so split the playlist into a few files (e.g. one per module) with clear headings.

Step 1 (free): playlist → one file with yt-dlp

pip install yt-dlp
mkdir subs && cd subs
yt-dlp --skip-download --write-subs --write-auto-subs \
  --sub-langs "en.*" --sub-format vtt \
  -o "%(playlist_index)03d - %(title)s.%(ext)s" \
  "https://www.youtube.com/playlist?list=YOUR_PLAYLIST_ID"
cd ..
Enter fullscreen mode Exit fullscreen mode

This downloads only subtitle files (no video), creator captions first, auto-captions otherwise, numbered in playlist order. Run it from a home connection; YouTube often blocks cloud and VPN IPs with a "confirm you're not a bot" error.

Then merge them. Raw .vtt auto-captions repeat each line two or three times, so dedupe while you merge:

import re
from pathlib import Path

TAG = re.compile(r"<[^>]+>")
out = ["# Playlist transcripts\n"]
for f in sorted(Path("subs").glob("*.vtt")):
    lines, last = [], None
    for raw in f.read_text(encoding="utf-8", errors="ignore").splitlines():
        s = TAG.sub("", raw).strip()
        if not s or s == "WEBVTT" or "-->" in s or s.startswith(("Kind:", "Language:")):
            continue
        if s != last:
            lines.append(s)
        last = s
    name = re.sub(r"\.[\w-]+\.vtt$", "", f.name)  # drop ".en.vtt"
    body = " ".join(lines)
    out.append(f"\n## {name}\n\n{body}\n")
Path("playlist.md").write_text("".join(out), encoding="utf-8")
print(len("".join(out).split()), "words")
Enter fullscreen mode Exit fullscreen mode

Step 2: prompt it like a long document, not a video

Headings per video are what make this work. The model can cite "## 007 - Backpropagation" instead of vaguely saying "in one of the videos".

Prompts that use the whole playlist:

  • "This file has one section per video. For each section, give one line: the main claim and the best example used."
  • "Where do videos 3 and 11 disagree? Quote both."
  • "Build a study plan: what to rewatch, in what order, for someone who already knows X."
  • "Turn the whole series into a checklist I can follow, with the video number next to each step."

Ask it to quote when it matters. Quotes from a transcript are checkable; paraphrases can drift.

Step 3 (optional): let the assistant fetch transcripts itself with MCP

MCP (Model Context Protocol) lets Claude, ChatGPT, Cursor and other clients call external tools. With a YouTube transcript MCP server connected, you can say "get the transcripts for this playlist and compare videos 2 and 5", and the assistant fetches the text itself.

You can self-host an open-source transcript MCP server (several exist on GitHub, most built on youtube-transcript-api). They work well locally, but the same IP blocking applies when you deploy them to a cloud server.

Or use a hosted one. I built YT Transcriber, which has a remote MCP server (disclosure: I'm the maker, a student). The setup is the same pattern for any remote MCP server:

  1. Get a key. Sign in, then Settings → API keys → Create, and copy it once. Then Settings → AI & Automations gives you the MCP server URL with the key included. Treat that URL like a password.
  2. Claude: Customize → Connectors → Add custom connector. Name it, paste the MCP URL, and choose no extra sign-in, since the URL carries the key.
  3. ChatGPT: Settings → Apps → Create MCP app. Paste the MCP URL, authentication: none.
  4. Cursor: Settings → MCP → New MCP server, preferably with the key in a header instead of the URL:
{
  "mcpServers": {
    "yt-transcriber": {
      "url": "https://13-234-185-132.sslip.io/mcp",
      "headers": { "Authorization": "Bearer ytk_YOUR_KEY" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

The server exposes five tools: submit_transcripts (video, playlist or channel URLs), list_jobs, get_transcript, export_transcript (txt, md, json, toon, srt, pdf) and check_quota. In the web app, a finished playlist can also be downloaded as one file for this exact workflow, auto-split under 450,000 words between videos.

Honest limits: it reads existing captions (no speech-to-text), so caption-less videos fail. The free tier is 3 videos a day after sign-in, and you can try one video on the homepage without signing in. Whole playlists are $9/month.

Summary

  • Don't trust a model that says it "watched" a YouTube link. Give it the transcript.
  • One file per playlist, a heading per video, in playlist order.
  • Check the size against your model's context; use Projects or knowledge files when it's bigger.
  • MCP turns "go get the transcript" into something the assistant can do on its own.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.