Skip to content

Commit 8ff15ae

Browse files
NoTranscriptFound: document the exact language-code matching gotcha, verified on the library and yt-dlp
1 parent 60a09bf commit 8ff15ae

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

‎data/errors.yaml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,28 @@ errors:
7373
message_detail: "The message continues with the list of transcripts that are available for the video."
7474
trigger: "None of the language codes passed in `languages` matches a manual or automatic caption track on the video."
7575
meaning: "The video has captions, just not in the language you asked for. The error text lists what is available."
76+
common_cause: |
77+
The language code has to match exactly. A request for `es` does not match a track whose code is `es-ES`, and a request for `en` does not match `en-US`, so a video that plainly has Spanish or English captions can raise this error.
78+
79+
Checked on 2026-10-18 with video `8YIZ_2QA1P8`, whose only track is `es-ES`: `YouTubeTranscriptApi().fetch("8YIZ_2QA1P8", languages=["es"])` raises `NoTranscriptFound`, and `languages=["es-ES"]` works. yt-dlp behaves the same way: `--sub-langs es` prints `There are no subtitles for the requested languages` and exits with status 0, while the pattern `--sub-langs "es(-[A-Z0-9]+)?"` downloads the `es-ES` track. Note that yt-dlp exits successfully when it finds nothing, so check that a subtitle file was actually written.
80+
81+
Call `list(video_id)` first to see the exact codes, or pass every variant you accept, for example `languages=["es", "es-ES", "es-419"]`.
7682
repro:
7783
kind: video
7884
video_id: "jNQXAC9IVRw"
7985
code: |
8086
from youtube_transcript_api import YouTubeTranscriptApi
8187
YouTubeTranscriptApi().fetch("jNQXAC9IVRw", languages=["xx"])
8288
actions:
83-
- "Read the available languages in the error text, or call `list(video_id)` and pick one."
89+
- "Read the available languages in the error text, or call `list(video_id)` and pick one. Regional codes such as `en-US` and `es-ES` count as different languages from `en` and `es`."
8490
- "Pass several codes in order of preference, for example `languages=[\"de\", \"en\"]`."
8591
- "Ask for a translated track with `.translate(code)` if the transcript is translatable."
86-
other_tools: []
92+
other_tools:
93+
- tool: yt-dlp
94+
text: "`There are no subtitles for the requested languages` (exit status 0) when `--sub-langs es` is asked of a video whose only track is `es-ES`."
95+
verified: true
96+
date: "2026-10-18"
97+
env: "home network, India"
8798
related: [NotTranslatable, TranslationLanguageNotAvailable]
8899

89100
- name: NotTranslatable

‎errors/notranscriptfound.md‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ The video has captions, just not in the language you asked for. The error text l
1616

1717
None of the language codes passed in `languages` matches a manual or automatic caption track on the video. (read from the library source)
1818

19+
## A common cause
20+
21+
The language code has to match exactly. A request for `es` does not match a track whose code is `es-ES`, and a request for `en` does not match `en-US`, so a video that plainly has Spanish or English captions can raise this error.
22+
23+
Checked on 2026-10-18 with video `8YIZ_2QA1P8`, whose only track is `es-ES`: `YouTubeTranscriptApi().fetch("8YIZ_2QA1P8", languages=["es"])` raises `NoTranscriptFound`, and `languages=["es-ES"]` works. yt-dlp behaves the same way: `--sub-langs es` prints `There are no subtitles for the requested languages` and exits with status 0, while the pattern `--sub-langs "es(-[A-Z0-9]+)?"` downloads the `es-ES` track. Note that yt-dlp exits successfully when it finds nothing, so check that a subtitle file was actually written.
24+
25+
Call `list(video_id)` first to see the exact codes, or pass every variant you accept, for example `languages=["es", "es-ES", "es-419"]`.
26+
1927
## Reproduce
2028

2129
Video ID: `jNQXAC9IVRw`
@@ -27,13 +35,15 @@ YouTubeTranscriptApi().fetch("jNQXAC9IVRw", languages=["xx"])
2735

2836
## What to do
2937

30-
- Read the available languages in the error text, or call `list(video_id)` and pick one.
38+
- Read the available languages in the error text, or call `list(video_id)` and pick one. Regional codes such as `en-US` and `es-ES` count as different languages from `en` and `es`.
3139
- Pass several codes in order of preference, for example `languages=["de", "en"]`.
3240
- Ask for a translated track with `.translate(code)` if the transcript is translatable.
3341

3442
## In other tools
3543

36-
Nothing recorded yet. If you know what another tool prints for this situation, please add it with a source.
44+
| Tool | What it prints | Observed |
45+
|---|---|---|
46+
| yt-dlp | `There are no subtitles for the requested languages` (exit status 0) when `--sub-langs es` is asked of a video whose only track is `es-ES`. | 2026-10-18, home network, India |
3747

3848
## Related
3949

‎scripts/build.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def page(err: dict) -> str:
6969
"",
7070
err["trigger"] + " (read from the library source)",
7171
"",
72+
]
73+
if err.get("common_cause"):
74+
out += ["## A common cause", "", err["common_cause"].strip(), ""]
75+
out += [
7276
"## Reproduce",
7377
"",
7478
]

0 commit comments

Comments
 (0)