youtube-caption
Skill2 starsChanged 44 days agoMITView on GitHub
Fetch YouTube video captions/transcripts and metadata. Use when you need to download video transcripts, extract captions from YouTube URLs, get video descriptions and metadata, or process YouTube video text content. Supports residential proxy for reliable caption and metadata fetching (credentials can be auto-loaded from environment or a shell startup file).
- Installs packages
In this repository41 other files it gives its agents.
- skills/web-asset-generator/CLAUDE.mdCLAUDE.md
- academic-writingSkill
- agent-os-childSkill
- agy-pSkill
- amazon-uk-scraperSkill
- artifact-variationsSkill
- audio-transcription-workflowSkill
- capture-dashboardSkill
- claude-channelsSkill
- claude-pSkill
- code-documenterSkill
- context7-docsSkill
- context7-searchSkill
- deep-researchSkill
- docx-draftSkill
- grill-meSkill
- handoffSkill
- long-horizon-waiting-strategiesSkill
- openapi-schemaSkill
- opencode-pluginSkill
- pi-extensionSkill
- pi-web-ui-internal-api-orchestrationSkill
- pptx-draftSkill
- saas-idea-finderSkill
- scraping-redditSkill
- scraping-twitterSkill
- secret-scanningSkill
- socialmedia-optimizationSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- text-to-speechSkill
- thematic-analysisSkill
- transcribe-audioSkill
- video-deep-understandingSkill
- video-useSkill
- web-asset-generatorSkill
- web-crawlingSkill
- web-create-assetsSkill
- web-data-acquisitionSkill
- webfetch-skillSkill
- youtube-searchSkill
The file
Files
YouTube Caption Fetcher
Download captions/transcripts and metadata from any YouTube video using the youtube-transcript-api library with optional residential proxy support.
Prerequisites
Required Python package:
pip install youtube-transcript-apiResidential Proxy Credentials (auto-loaded from environment or a shell startup file):
# Reddit proxy for YouTube caption and metadata fetching
export YOUTUBE_PROXY_URL="http://username:password@host:port"
# legacy fallback also supported:
export REDDIT_PROXY_URL="http://username:password@host:port"The skill automatically fetches these credentials from the environment or a shell startup file when caption or metadata fetching requires proxy support.
Quick Start
Fetch captions and metadata:
python3 ./scripts/fetch_caption.py --url "https://www.youtube.com/watch?v=VIDEO_ID"Fetch only metadata (uses proxy):
python3 ./scripts/fetch_caption.py --url "https://youtu.be/VIDEO_ID" --metadata-onlyFetch captions only (uses proxy):
python3 ./scripts/fetch_caption.py --url "https://www.youtube.com/watch?v=VIDEO_ID" --captions-onlyParameters
| Parameter | Required | Default | Description |
--url or -u | Yes | - | YouTube video URL (supports various formats) |
--metadata-only | No | false | Fetch only video metadata (uses proxy) |
--captions-only | No | false | Fetch only captions (uses proxy) |
--language or -l | No | en | Language code for captions (e.g., en, es, fr) |
--output or -o | No | - | Save output to JSON file |
Output Format
Returns JSON with both captions and metadata:
{
"success": true,
"video_id": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"metadata": {
"title": "Video Title",
"description": "Full video description...",
"channel": "Channel Name",
"channel_id": "UC...",
"published_at": "2025-01-15T10:00:00Z",
"duration": "10:30",
"duration_seconds": 630,
"view_count": 1000000,
"thumbnail": "https://i.ytimg.com/vi/...",
"links_in_description": [
"https://example.com/link1",
"https://example.com/link2"
]
},
"captions": {
"text": "Full transcript text...",
"language": "en",
"is_generated": true,
"word_count": 1500,
"duration_seconds": 630
}
}How It Works
- Caption fetching: Uses
youtube-transcript-apiwith residential proxy (to avoid IP blocks) - Metadata fetching: Uses
urllibwith residential proxy (to bypass YouTube bot detection) - Proxy credentials: Automatically loaded from the environment or a shell startup file (
YOUTUBE_PROXY_URL, or legacyREDDIT_PROXY_URL)
Error Handling
| Error | Cause | Solution |
TranscriptsDisabled | Video has captions disabled | Try another video |
NoTranscriptFound | No captions in requested language | Try --language with different code |
VideoUnavailable | Video is private/deleted | Check video URL |
ProxyError | Proxy connection failed | Check proxy credentials in your environment or shell startup file |
Usage Examples
Get full video data:
python3 ./scripts/fetch_caption.py --url "https://www.youtube.com/watch?v=VIDEO_ID" -o output.jsonGet captions in Spanish:
python3 ./scripts/fetch_caption.py --url "https://youtu.be/VIDEO_ID" --language esExtract just the transcript text:
python3 ./scripts/fetch_caption.py --url "URL" --captions-only | jq -r '.captions.text'Get metadata with links from description:
python3 ./scripts/fetch_caption.py --url "URL" --metadata-only | jq '.metadata.links_in_description'Notes
- Proxy is used for both caption AND metadata fetching to bypass YouTube bot detection
- Supports auto-generated and manual captions
- Falls back gracefully if captions are unavailable
- Metadata includes
links_in_descriptionarray extracted from the video description
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

