youtube-transcript-api errors
TranscriptsDisabled in youtube-transcript-api
Why youtube-transcript-api says subtitles are disabled for a video, how to tell a missing caption track from a block, and how to still get the transcript.
Running this on a server? TranscriptFetch returns the same transcript from any IP, no proxies. Try it free →
The video has no caption track the library can read: neither captions the creator uploaded nor the ones YouTube generates automatically.
The error
youtube_transcript_api._errors.TranscriptsDisabled:
Could not retrieve a transcript for the video https://www.youtube.com/watch?v=VIDEO_ID! This is most likely caused by:
Subtitles are disabled for this videoWhat triggers it
In version 1.2.4 the library reads the caption list from the video page. When that list is missing, or holds no caption tracks, it raises TranscriptsDisabled. Auto-generated captions count as captions here, so this error means neither kind exists.
Why a video has no captions
- The creator turned captions off.
- YouTube did not generate automatic captions. It does not caption every video: music with little speech, unclear audio, languages it does not caption automatically and very recent uploads often have none.
Confirm it in a minute
- Open the video on YouTube in a signed-out window. If there is no CC button and no "Show transcript" option, the video has no captions.
- If YouTube does show captions but the library raises
TranscriptsDisabled, run the same call from your laptop. If it works there, your server is being treated differently: see RequestBlocked.
Fixes
1. There is nothing to turn on
No library option can enable captions on someone else's video. If the transcript has to come from captions, skip the video:
from youtube_transcript_api import TranscriptsDisabled, YouTubeTranscriptApi
try:
transcript = YouTubeTranscriptApi().fetch(video_id)
except TranscriptsDisabled:
transcript = None # no caption track at all2. Transcribe the audio yourself
The words are still in the audio. Download it (for example with yt-dlp) and run a speech-to-text model such as Whisper. It works, but you run the download, the model and the hardware, and downloading from a server runs into the same blocking as the library.
3. Use an API that transcribes when captions are missing
TranscriptFetch (our product) reads the captions when a video has them and transcribes the audio with AI when it does not, in the same call:
# pip install transcriptfetch-sdk
from transcriptfetch import TranscriptFetch
tf = TranscriptFetch(api_key="tf_live_...")
t = tf.transcripts.video("https://www.youtube.com/watch?v=VIDEO_ID", timestamps=False)
print(t.source) # "captions", or "audio" when it was transcribed
print(t.text)AI transcription is billed at 1 credit per started 5 minutes of audio, only when the transcript is delivered. Longer videos come back as a job to poll. 50 free credits a month.
FAQ
Do auto-generated captions count?
Yes. The library reads uploaded and auto-generated captions alike, so TranscriptsDisabled means the video has neither.
Can I enable captions on a video I don't own?
No. Only the channel can add or enable captions.
The video shows captions on YouTube, so why does the library say they are disabled?
Check whether it happens only on your server. If the same call works from your laptop, the server's requests are being treated differently: see RequestBlocked.
Need transcripts that work from a server?
TranscriptFetch fetches YouTube, TikTok and Instagram transcripts from its own network, with AI transcription when a video has no captions. Free credits every month, no card.