YT Downloader is a single-file, stateless YouTube downloader. No database, no authentication, no sessions. Paste a URL, choose quality, and download. Everything runs from one FastAPI app.
All endpoints return JSON (except download endpoints which stream files).
Returns video metadata — title, thumbnail, duration, available formats.
{
"title": "Example Video",
"thumbnail": "https://i.ytimg.com/vi/.../maxresdefault.jpg",
"duration": "4:32",
"duration_seconds": 272,
"channel": "Channel Name",
"formats": [
{"format_id": "137", "ext": "mp4", "height": 1080, "label": "1080p", "filesize": 12345678},
{"format_id": "136", "ext": "mp4", "height": 720, "label": "720p", "filesize": 6543210}
]
}
Streams the video file as an MP4 attachment. Quality defaults to best.
Extracts audio and streams as an MP3 attachment (192 kbps).
# Get info
curl "https://your-app.com/yt/info?url=https://youtube.com/watch?v=dQw4w9WgXcQ"
# Download best video
curl -o video.mp4 "https://your-app.com/yt/video?url=https://youtube.com/watch?v=dQw4w9WgXcQ"
# Download 720p video
curl -o video.mp4 "https://your-app.com/yt/video?url=https://youtube.com/watch?v=dQw4w9WgXcQ&quality=720"
# Download audio
curl -o audio.mp3 "https://your-app.com/yt/audio?url=https://youtube.com/watch?v=dQw4w9WgXcQ"
pip install -r requirements.txt
uvicorn main:app --reload --port 8000
docker build -t yt-downloader .
docker run -p 8000:8000 yt-downloader
Push to GitHub → create new service → select your repo. Railway auto-detects the Dockerfile. Render users should use the Docker deploy method.
| Component | Version |
|---|---|
| Python | 3.11+ |
| FastAPI | latest |
| yt-dlp | latest (auto-upgraded) |
| ffmpeg | system package |
| Jinja2 | latest |
| uvicorn | latest |