YouTube Transcript English
Use this skill when a YouTube transcript must come back in English.
Source
- Upstream repository:
https://github.com/jdepoix/youtube-transcript-api - Integrated source commit:
85c859450c014d860297ab9fd4f88145c47ff2e2 - Local checkout:
%USERPROFILE%\.youtube-transcript-api\youtube-transcript-api - Isolated venv CLI:
%USERPROFILE%\.youtube-transcript-api\venv\Scripts\youtube_transcript_api.exe - English-enforcing shim:
%USERPROFILE%\.youtube-transcript-api\bin\youtube-transcript-english.cmd
README-Grounded Usage
The upstream README states that YouTubeTranscriptApi().fetch(video_id) defaults to English, accepts languages=['en'], supports TranscriptList, and can translate transcripts with transcript.translate('en') when translation is available.
Use the bundled English wrapper first:
& "$env:USERPROFILE\.youtube-transcript-api\venv\Scripts\python.exe" scripts\fetch_english_transcript.py "https://www.youtube.com/watch?v=VIDEO_ID"
& "$env:USERPROFILE\.youtube-transcript-api\venv\Scripts\python.exe" scripts\fetch_english_transcript.py VIDEO_ID --format json --output transcript.json
& "$env:USERPROFILE\.youtube-transcript-api\venv\Scripts\python.exe" scripts\fetch_english_transcript.py VIDEO_ID --format srt --output transcript.srt
& "$env:USERPROFILE\.youtube-transcript-api\venv\Scripts\python.exe" scripts\fetch_english_transcript.py VIDEO_ID --ai-model gpt-4o-mini
Equivalent direct command:
& "$env:USERPROFILE\.youtube-transcript-api\bin\youtube-transcript-english.cmd" VIDEO_ID --format text
Use the upstream CLI when exact upstream behavior is needed:
& "$env:USERPROFILE\.youtube-transcript-api\venv\Scripts\youtube_transcript_api.exe" VIDEO_ID --languages en --format json
& "$env:USERPROFILE\.youtube-transcript-api\venv\Scripts\youtube_transcript_api.exe" --list-transcripts VIDEO_ID
English Output Policy
- Request direct English captions first.
- If direct English is unavailable, inspect available transcripts.
- If a transcript is translatable to English, translate it to English.
- If YouTube cannot provide English, fetch the best available source transcript and translate caption segments to English with an OpenAI-compatible model.
- If no transcript exists or AI translation is required but
OPENAI_API_KEYis not set, fail clearly instead of returning a non-English transcript.
Add --no-translate to require direct English captions only. Add --no-ai-translate to allow YouTube translation but disable AI translation fallback.
AI translation settings:
OPENAI_API_KEYis required only when AI translation fallback is needed.OPENAI_TRANSLATION_MODELorAI_TRANSLATION_MODELcan override the default model.OPENAI_BASE_URLcan point at an OpenAI-compatible endpoint.--ai-chunk-sizecontrols how many caption segments are translated per request.
References
references/source-readme.mdcontains the full upstream README.references/requirements-lock.txtdocuments installed dependencies.references/source-metadata.jsonrecords the integrated commit and local paths.
Reliability Notes
- YouTube can block requests from some IPs. The upstream README documents
RequestBlockedandIpBlockedbehavior and proxy options. - The library uses an undocumented YouTube web-client API, so live behavior can change.
- For bulk or repeated fetching, respect rate limits and avoid unnecessary retries.