π Try Live Demo | β Star on GitHub | π» CLI Guide
A powerful tool to fetch YouTube video transcripts via Web UI or CLI, with intelligent proxy support to bypass rate limiting.
- Web UI: Browser-based interface for fetching transcripts
- CLI: Command-line interface for automation and scripting
- Smart Proxy Support: Automatic proxy configuration to bypass YouTube rate limiting
- Multiple Languages: Fetch transcripts in different languages
- Multiple Formats: Output as plain text or JSON
- Smart Caching: Database-backed caching to avoid redundant API calls
π Try Live Demo
Works instantly in your browser - no installation required!
Perfect for: Quick transcripts, testing, non-technical users
Fetch transcripts from the command line. See Installation below for all installation methods.
# Example: Fetch transcript by URL
ytt fetch "https://youtu.be/dQw4w9WgXcQ"Perfect for: Automation, scripting, power users
Deploy your own instance:
π Deployment Guide
Perfect for: Production use, custom configuration, full control
brew tap nilukush/ytt
brew install youtube-transcript-toolsWhy Homebrew?
- β Single command installation
- β Automatic dependency management
- β
Easy updates:
brew upgrade youtube-transcript-tools - β Native macOS package manager
pipx installs Python CLI tools in isolated environments, avoiding PEP 668 "externally-managed-environment" errors on macOS.
# Install pipx (one-time setup)
brew install pipx
pipx ensurepath
# Install ytt
pipx install youtube-transcript-toolsWhy pipx?
- β No system Python conflicts
- β PEP 668 compliant
- β
Easy updates:
pipx upgrade ytt - β Isolated from other tools
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install
pip install youtube-transcript-toolspip install youtube-transcript-toolsNote: If you see error: externally-managed-environment, use Option 1 (Homebrew), Option 2 (pipx), or Option 3 (virtual environment).
git clone https://github.com/nilukush/youtube-transcript.git
cd youtube-transcript
pip install -e .pip install -e ".[dev]"The Web UI provides the simplest way to fetch transcripts:
Starting the server:
uvicorn youtube_transcript.api.app:create_app --reload --host localhost --port 8888Then open http://localhost:8888 in your browser.
Supported URL formats:
https://youtu.be/dQw4w9WgXcQ(shortened)https://www.youtube.com/watch?v=dQw4w9WgXcQ(full URL)dQw4w9WgXcQ(video ID only)
The CLI uses a fetch command to retrieve transcripts.
Quick examples:
# Fetch by URL
ytt fetch "https://youtu.be/dQw4w9WgXcQ"
# Fetch by video ID
ytt fetch dQw4w9WgXcQ
# Save to file
ytt fetch dQw4w9WgXcQ -o transcript.txt
# Output as JSON
ytt fetch dQw4w9WgXcQ --jsonBasic usage:
ytt fetch "https://youtu.be/dQw4w9WgXcQ"Advanced options:
# Language preference
ytt fetch dQw4w9WgXcQ --lang en
# Multiple languages
ytt fetch dQw4w9WgXcQ --lang en,es,fr
# Save to file
ytt fetch dQw4w9WgXcQ -o transcript.txt
# JSON output
ytt fetch dQw4w9WgXcQ --json
# Verbose mode
ytt fetch dQw4w9WgXcQ --verboseAll options:
Usage: ytt fetch [OPTIONS] URL_OR_ID
Options:
--lang, -l TEXT Preferred language codes (comma-separated)
--output, -o TEXT Output file path
--json Output in JSON format
--verbose Show detailed information
--help, -h Show this message
Wrong:
ytt "https://youtu.be/dQw4w9WgXcQ"Correct:
ytt fetch "https://youtu.be/dQw4w9WgXcQ"This means:
- The video doesn't have captions/subtitles enabled
- The transcript is disabled by the uploader
- The video ID is incorrect
Verification: Check if the video has captions on YouTube:
- Open the video on YouTube
- Click the "..." (more) button
- Look for "Show transcript" option
If you experience rate limiting:
- The application automatically uses proxy configuration (if set by the service provider)
- Try again later - rate limits reset over time
- Some videos may have stricter rate limits than others
If ytt command is not found:
# Reinstall the package
pip install -e .
# Or use Python module directly
python -m youtube_transcript.cli fetch "https://youtu.be/dQw4w9WgXcQ"# Run all tests
pytest
# Run with coverage
pytest --cov=src/youtube_transcript --cov-report=html
# Run specific test file
pytest tests/test_fetcher.py -v# Format code
black src/ tests/
# Lint code
ruff check src/ tests/
# Type check
mypy src/youtube-transcript/
βββ src/youtube_transcript/
β βββ api/ # FastAPI endpoints and web routes
β βββ cache/ # Redis caching layer
β βββ config/ # Configuration management
β βββ models/ # SQLModel database models
β βββ repository/ # Database repository layer
β βββ services/ # Business logic (fetcher, orchestrator)
β βββ static/ # CSS and static assets
β βββ templates/ # Jinja2 HTML templates
β βββ utils/ # URL parsing utilities
β βββ cli.py # CLI entry point
βββ tests/ # Pytest tests
βββ pyproject.toml # Project configuration
The web server exposes the following endpoints:
GET /- Web UI homepageGET /transcript?url=URL- Fetch transcript via GETGET /transcript/{video_id}- Fetch transcript by video IDGET /htmx/transcript?url=URL- HTMX endpoint for dynamic updatesGET /docs- Interactive API documentation (FastAPI auto-docs)
| Metric | Target | Status |
|---|---|---|
| Cached Response | p95 < 500ms | β Met |
| Uncached Response | p95 < 10s | β Met |
| Test Coverage | > 80% | β Met (100%) |
| URL Parse Success | > 99.5% | β Met |
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Write tests for your changes
- Ensure all tests pass
- Submit a pull request
If you're deploying this application as a service, see DEPLOYMENT.md for:
- Proxy configuration
- Environment variables
- Production deployment
- Scaling considerations
MIT License - see LICENSE file for details.
- youtube-transcript-api - Core transcript fetching library
- FastAPI - Modern web framework
- Typer - CLI framework
- Issues: GitHub Issues
- Deployment Guide: DEPLOYMENT.md
