November 23, 2026 · 6 min read
youtube-transcript-api CouldNotRetrieveTranscript: Every Cause and Fix
In short
CouldNotRetrieveTranscript is the base error for every failure in youtube-transcript-api. Find your cause, from blocked IP to live or age-restricted video, and fix it.
CouldNotRetrieveTranscript is not one error. It is the parent class youtube-transcript-api raises for every failure, and the message under it names the real cause: a blocked IP, a video with captions disabled, a live stream, a region lock, an age gate, or a members-only video. Read the cause line first, because the fix differs for each, and for most of them the fastest route is the TranscriptYT API or the free YouTube transcript tool.
What CouldNotRetrieveTranscript means
In youtube-transcript-api 1.x, CouldNotRetrieveTranscript is the base exception. Its subclasses carry the specific reason, and the message always has the same shape: "Could not retrieve a transcript for the video ... This is most likely caused by:" followed by one cause line.
That means you can catch the base class to handle everything, or catch subclasses to react differently. Catching only the base class hides which fix you need, so log the exception type and message at least once.
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api._errors import CouldNotRetrieveTranscript
try:
YouTubeTranscriptApi().fetch("5f3Pn-N6yLc")
except CouldNotRetrieveTranscript as e:
print(type(e).__name__)
print(e)Blocked IP: RequestBlocked and IpBlocked
This is the most common cause in production. The message says YouTube is blocking requests from your IP, and it usually appears on AWS, Google Cloud, Azure, Vercel, and other hosts whose datacenter IP ranges YouTube distrusts. The same code works on your laptop because a home connection has a residential IP. Heavy use can get a home IP blocked for a while too.
The fix is to change where the request comes from, not the code. Route the library through a residential proxy, run the job from a residential connection, or call a hosted API so your server never talks to YouTube. The full walkthrough, including proxy config, is in Fix youtube-transcript-api RequestBlocked and IpBlocked.
With TranscriptYT the fetch runs on its own proxy network. If YouTube temporarily blocks an exit, you get a 503 with the code BLOCKED and can retry shortly.
curl "https://transcript-yt.com/v1/transcript?url=5f3Pn-N6yLc" \ -H "Authorization: Bearer $TRANSCRIPTYT_KEY"
Subtitles disabled: TranscriptsDisabled
"Subtitles are disabled for this video" means there is no caption track at all, neither uploaded by the creator nor auto-generated. This is common for music, very short clips, brand new uploads, and videos where the creator turned captions off. A proxy will not help, because there is nothing to fetch.
The only way to get text is speech-to-text on the audio. You can run Whisper yourself, or use an API that falls back to it. On TranscriptYT a video with captions costs 1 credit, and a video without captions is transcribed from the audio at 1 credit per started minute, up to 2 hours per video by default. AI transcription needs a paid plan or a credit pack. Free accounts get captions only and receive NO_CAPTIONS for a caption-less video.
One edge case: if the CC button works in your browser but the library says disabled, YouTube may have served a reduced response to a flagged IP. Treat it like a blocked IP and retry from another network. See TranscriptsDisabled: what to do and transcribing a video without captions.
Live streams and premieres
A stream that is live or has not started yet has no finished caption track, so the request fails with a message that the video is unplayable or the live event has not ended. Just-ended streams are tricky too: YouTube can take hours to produce auto-captions, so a request right after the stream ends often fails and the same request a day later succeeds.
The fix is to wait, then retry. In code, schedule a retry after the stream ends instead of looping tightly. If you need the text of a recorded stream that never gets captions, transcribe its audio once it is finished. The live stream transcript page explains the options, and the free tool can email you when a stream's transcript is ready.
- Check the video is no longer live before you fetch.
- For a just-ended stream, retry after a few hours rather than every few seconds.
- Past streams of many hours may need AI transcription, which has a length limit per video.
Region-locked and unavailable videos
A region-locked video is blocked in the country your request comes from, and the library reports the video as unavailable or unplayable. A private or deleted video produces a similar message, so check the video in a browser first: if it plays for you from another country but not from your server, it is a region lock.
With the library, the fix is to send the request through a proxy in a country where the video plays. With TranscriptYT, some region-locked videos are retried from another country automatically, and a video that is private, deleted, or still locked returns VIDEO_UNAVAILABLE with HTTP 404 and is not billed. The docs list every error code.
Age-restricted videos
The library raises AgeRestricted when YouTube demands a signed-in, age-verified account before it will play the video. An anonymous request, which is all youtube-transcript-api makes, never passes that check, and the library has no supported way to pass a logged-in session.
Proxies and retries will not change this. Your realistic options are to download the captions yourself while signed in to an adult account in the YouTube interface, or accept that the video cannot be fetched anonymously. TranscriptYT cannot fetch age-restricted videos either, and says so in the error message instead of retrying and charging you.
Members-only and private videos
Members-only videos need an authenticated channel member, and private videos need the owner's permission. The library reports them as unplayable, usually with a line such as "This video is private" or a prompt to join the channel. No outside tool, including hosted APIs, can read them.
If you own the video or channel, use YouTube Studio to export the captions. If you do not, ask the creator. Do not spend time on retries or proxies for these.
Quick fix table
Match the cause line to the action. Only the first two rows are fixable from code.
import os, requests
res = requests.get(
"https://transcript-yt.com/v1/transcript",
params={"url": "5f3Pn-N6yLc"},
headers={"Authorization": f"Bearer {os.environ['TRANSCRIPTYT_KEY']}"},
timeout=300,
)
if res.status_code == 200:
print(res.json()["segments"][:3])
else:
print(res.json()["error"]["code"]) # NO_CAPTIONS, VIDEO_UNAVAILABLE, BLOCKED ...- RequestBlocked or IpBlocked: use a residential proxy, another network, or a hosted API.
- TranscriptsDisabled: transcribe the audio with Whisper or an API that does it for you.
- Live or just ended: wait for the stream to finish and for captions to appear, then retry.
- Region lock: request from a country where the video plays.
- AgeRestricted, members-only, private: not available to anonymous tools. Export from YouTube Studio if you own it.
Skip the error handling with a hosted API
The TranscriptYT API returns the same segments with start times and durations, handles proxies and retries, and uses one error envelope, so each of the causes above maps to a stable code you can branch on. The free plan includes 100 credits, one time, with captions only. Paid plans start at $3 a month for 1,000 credits, and a 1-credit transcript request is not charged when it fails.
For a single video, paste the link into the free transcript tool. For code, see the Python guide and the NoTranscriptFound fix, which covers the language-code mismatch that looks similar but has a different cause.
Common questions
What does CouldNotRetrieveTranscript mean in youtube-transcript-api?
It is the base exception for every failure to get a transcript. The subclass and the cause line in the message tell you why: blocked IP, disabled subtitles, live stream, region lock, age restriction, or a private or members-only video.
Why does CouldNotRetrieveTranscript only happen on my server and not locally?
Almost always a blocked IP. YouTube trusts home connections but blocks or limits many datacenter ranges, so use a residential proxy or a hosted API on cloud servers.
Can youtube-transcript-api get transcripts of age-restricted videos?
No. YouTube requires a signed-in, age-verified account for them, and the library makes anonymous requests. Retries and proxies do not help.
How do I get a transcript when subtitles are disabled?
Transcribe the audio with a speech-to-text model such as Whisper, or use an API that does it. TranscriptYT does this for paid plans and credit packs at 1 credit per started minute.