A fast and lightweight YouTube video downloader built with Flask. This application allows users to download videos and audio directly from YouTube in multiple formats and resolutions, including MP4 (HD) and MP3.
Designed for simplicity and speed, the YouTube Downloader provides a clean interface where users can paste a video link and instantly download content for offline use. It ensures high-quality downloads, quick processing, and a smooth user experience.
Whether you want to save tutorials, music, or videos for offline viewing, this tool makes the process effortless and efficient.
💡 Live Demo: YouTube Downloader (Live Website)
- 🔍 Search & Extract - Fetch video metadata (title, thumbnail, duration, uploader)
- 🎥 Video Downloads - Download videos in multiple quality formats (MP4)
- 🎵 Audio Downloads - Download audio-only formats (M4A, MP3)
- 🍪 Cookie Support - Optional authentication via cookies.txt for private videos
- ☁️ Cloud Ready - Deployable to Vercel with zero configuration
- 🌐 Cross-Platform - Works on Windows, macOS, and Linux
| Technology | Description |
|---|---|
| Python 3.8+ | Backend runtime |
| Flask 2.3.3 | Web framework |
| yt-dlp | YouTube downloader library |
| HTML/CSS/JS | Frontend UI |
Before installing, make sure you have:
- Python 3.8 or higher installed
- pip package manager
python --version
pip --versiongit clone https://github.com/Blue-Rangoon/youtube-downloader.git
cd youtube-downloader# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python -m venv venv
source venv/bin/activatepip install Flask==2.3.3 yt-dlpOr install all requirements at once:
pip install -r requirements.txtIf downloading private or age-restricted videos:
- Export cookies from your browser as
cookies.txt - Place the file in the project root directory
youtube-downloader/
├── cookies.txt # Optional
├── requirements.txt
├── api/
└── ...
cd api
python app.pyOpen your browser and visit: http://localhost:5000
- Enter a YouTube video URL
- Click the search button
- Select your desired quality format
- Download the video or audio
# Check if server is running
curl http://localhost:5000/
# Download video info
curl -X POST http://localhost:5000/download \
-H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'Example Response:
{
"title": "Rick Astley - Never Gonna Give You Up",
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"duration": 213,
"uploader": "RickAstleyVEVO",
"videos": [
{
"quality": "1080p",
"format_id": "137",
"ext": "mp4",
"filesize": null
}
],
"audios": [
{
"quality": 128,
"format_id": "140",
"ext": "m4a",
"filesize": null
}
],
"platform": "YouTube"
}This project is configured for Vercel deployment:
# Install Vercel CLI
npm i -g vercel
# Deploy
vercelOr connect your GitHub repository to Vercel for automatic deployments.
youtube-downloader/
├── api/
│ └── app.py # Main Flask application
├── static/
│ ├── index.css # Styling
│ └── index.js # Frontend logic
├── templates/
│ └── index.html # User interface
├── vercel.json # Vercel configuration
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
└── README.md # This file
Edit api/app.py:
app.run(port=5000, debug=True)Modify ydl_opts in api/app.py:
ydl_opts = {
"quiet": True,
"skip_download": True,
"extractor_args": {"youtube": ["client=android,web"]}
}Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational purposes only. Please respect YouTube's Terms of Service and only download content you have the right to download.
