跳到正文
DEV Community· Faisal Ashfaq·· 2 小時前AI 評分57

如何取得 YouTube 影片逐字稿:4 種免費方法

How to Get a Transcript of Any YouTube Video (4 Free Methods)

AI 導讀

Faisal Ashfaq 整理了取得 YouTube 影片逐字稿的 4 種免費方法,包括 YouTube 內置逐字稿面板、YouTubeScribe、YouTube Studio,以及 yt-dlp 或 youtube-transcript-api。YouTubeScribe 可將現有字幕整理並下載為 TXT 或 SRT。這些方法都依賴影片已有字幕軌,引用自動生成字幕前應回到相應時間戳聆聽核對。

正文

Sometimes you don't want to watch a video, you want to read it. Maybe you need to quote a conference talk accurately, skim a 90-minute lecture for the one part that matters, or paste a tutorial's steps into your notes.

Almost every way of getting a YouTube transcript relies on the same thing: the video's caption track. YouTube automatically generates captions for most uploads in supported languages, and many creators upload their own. If a video has a caption track, you can get its text for free. If it doesn't, no "transcript tool" can pull text out of thin air. At that point you need actual speech-to-text, which is a different (and usually paid or compute-heavy) job.

With that in mind, here are four free methods, from zero-setup to fully scriptable.


Method 1: YouTube's built-in transcript panel

YouTube has a transcript viewer built in, and plenty of people don't know it exists.

On desktop:

  1. Open the video on youtube.com.
  2. Click the description under the video to expand it (the "...more" link).
  3. Scroll to the bottom of the description and click Show transcript.
  4. A transcript panel opens next to the video, with a timestamp beside every line.

You can click any line to jump to that moment. The panel's menu lets you toggle timestamps off, and a language selector appears if the video has more than one caption track.

On mobile: open the video, tap the description, and look for Show transcript in the same place.

Good for: quickly reading or searching a single video with no extra tools.

Limitations: the text lives inside a scrolling panel. You can select and copy it, but long transcripts are awkward to copy cleanly, timestamps get mixed into the text, and there's no download button. If you just need to find one quote, it's perfect. If you need a file, read on.


Method 2: A free web tool (YouTubeScribe)

If you want a downloadable file, a web-based transcript tool saves you the copy-paste work. I'll use YouTubeScribe as the example here. Full disclosure: I work on it, so I'll stick to what it actually does.

  1. Copy the video URL. Regular watch links, Shorts, youtu.be short links and embed URLs all work.
  2. Paste it into the box on the homepage and click Get transcript.
  3. Read the timestamped transcript, toggle timestamps on or off, then copy it or download it as TXT or SRT.

What's happening under the hood is the same as Method 1: it reads the caption track YouTube already has (auto-generated or uploaded) and formats it. That means:

  • It works on public and unlisted videos that have captions, in any language the video has a track for (125+ languages are supported).
  • Private and members-only videos won't work, and neither will videos with no caption track. You get a clear "no transcript" result instead of invented text.
  • TXT and SRT downloads are free, and you don't need an account for your first transcript.

If you specifically need the caption file with its timing intact, for example to re-upload subtitles or load them into a video editor, the subtitle downloader saves it as SRT or VTT.

Good for: getting a clean file in a few seconds without installing anything.

Other honest options: there are several similar free web tools (DownSub, Tactiq's YouTube transcript page, YouTubeToTranscript and others). They all read the same caption track, so the text will be identical. The differences are in formats, limits and how much the interface gets in your way. Try a couple and keep the one you like.


Method 3: YouTube Studio (for your own videos)

If the video is yours, you already have direct access to the caption files.

  1. Go to YouTube Studio.
  2. Open Subtitles from the left menu and choose the video.
  3. Next to the language track you want, open the options menu and download the file. You'll usually get a choice of formats such as .srt, .vtt or .sbv.

This is also the best place to fix auto-generated captions. Edit them in Studio and every later transcript (from any method in this article) will reflect your corrections.

Good for: creators repurposing their own content into blog posts, show notes or newsletters.

Limitations: only works for videos on channels you manage.


Method 4: Command-line and code (for developers)

If you need transcripts for many videos, or want them inside a script or pipeline, use the open-source tools.

yt-dlp

yt-dlp is the well-known open-source downloader, and it can fetch just the subtitles:

yt-dlp --skip-download --write-subs --write-auto-subs \
  --sub-langs "en.*" --convert-subs srt \
  "https://www.youtube.com/watch?v=VIDEO_ID"
  • --write-subs grabs uploaded (human) captions; --write-auto-subs grabs auto-generated ones.
  • --convert-subs srt needs ffmpeg installed.
  • It also works on playlists, which is handy for a whole lecture series.

youtube-transcript-api (Python)

For Python projects, youtube-transcript-api returns the transcript as data:

from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import SRTFormatter

ytt_api = YouTubeTranscriptApi()
transcript = ytt_api.fetch("VIDEO_ID", languages=["en"])

for snippet in transcript:
    print(f"{snippet.start:7.1f}s  {snippet.text}")

with open("video.srt", "w", encoding="utf-8") as f:
    f.write(SRTFormatter().format_transcript(transcript))

Good for: batch jobs, research datasets and anything you want to automate.

Limitations: YouTube may rate-limit or block requests, especially from cloud servers and data-centre IPs. Please respect YouTube's Terms of Service and creators' rights. Fetching captions for personal notes or research is very different from republishing someone's content wholesale.


Which method should you use?

You want to… Use
Read or search one video right now YouTube's transcript panel
Get a TXT or SRT file without installing anything A web tool like YouTubeScribe
Export or fix captions on your own videos YouTube Studio
Process dozens or hundreds of videos yt-dlp or youtube-transcript-api

A note on accuracy

Auto-generated captions are good, but they're not perfect. They struggle with names, jargon, heavy accents, crosstalk and music. Before you quote someone in an article, paper or social post, click back to the timestamp and listen to make sure the words are right. A transcript is a fantastic index into a video, but it doesn't replace the video itself.

And if a video has no captions at all, none of the above will help. You'd need a speech-to-text model (for example, running OpenAI's open-source Whisper locally on audio you have the right to use).

Happy reading, and enjoy getting your evenings back from 90-minute videos.

來源:DEV Community · dev.to