A modern, elegant web application for downloading YouTube videos and audio files. Built with FastAPI backend and vanilla JavaScript frontend, featuring a clean black & white minimalist design.
- π₯ Video Downloads - Download YouTube videos in MP4 format
- π΅ Audio Extraction - Extract audio as MP3 files
- π¨ Modern UI - Clean, minimalist black & white design
- β‘ Fast & Efficient - Direct file streaming to browser
- π Auto-start - Configure to start automatically on system login
- π Network Access - Accessible from your local network
The application features a sleek, modern interface with:
- Clean white container on subtle gradient background
- Smooth hover animations and transitions
- Responsive design that works on all devices
- Intuitive user experience
- Python 3.9 or higher
- FFmpeg (for video/audio processing)
- Internet connection
-
Clone or download this repository
-
Install Python dependencies:
pip install -r requirements.txt
-
Install FFmpeg:
- Windows: Download from ffmpeg.org and add to PATH
- macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg(Ubuntu/Debian)
The server is configured to run on:
- IP Address:
172.22.112.1 - Port:
2847
To change these settings, edit:
launcher.py- Server IP and port configurationindex.js- Frontend API endpoint URLs
Option 1: Using the Launcher (Recommended)
python launcher.pyor simply double-click start.bat on Windows.
Option 2: Direct uvicorn
uvicorn download:app --host 172.22.112.1 --port 2847- Start the server using one of the methods above
- The application will automatically open in your default browser
- Enter a YouTube URL in the input field
- Select "Video" or "Audio" from the dropdown
- Click "Download" to start the download
- The file will download to your browser's default download location
See STARTUP_PLAN.md for detailed instructions on setting up automatic startup:
- Task Scheduler (Recommended) - Most reliable method
- Startup Folder - Simplest method
- Windows Service - Advanced method
DFYT/
βββ download.py # FastAPI backend server
βββ index.html # HTML structure
βββ index.js # Frontend JavaScript
βββ home.css # Styling
βββ launcher.py # Server launcher script
βββ start.bat # Windows batch launcher
βββ requirements.txt # Python dependencies
βββ STARTUP_PLAN.md # Auto-startup instructions
βββ downloads/ # Temporary download directory
- Framework: FastAPI
- Video Processing: yt-dlp
- File Handling: Temporary files cleaned up after serving
- Vanilla JavaScript - No frameworks required
- Modern CSS - Clean, responsive design
- Fetch API - For server communication
- User enters URL and selects format
- Frontend sends POST request to
/download/v2 - Backend downloads file using yt-dlp
- File is streamed back to browser with proper headers
- Browser triggers download with correct filename
- Temporary files are cleaned up automatically
Downloads a video or audio file from YouTube.
Request Body:
{
"url": "https://www.youtube.com/watch?v=...",
"type": "video" // or "audio"
}Response:
- Returns file as download with
Content-Dispositionheader - Includes
X-Filenameheader with the actual filename
CORS preflight handler.
- Check if Python is installed and in PATH
- Verify all dependencies are installed:
pip install -r requirements.txt - Check if port 2847 is available (or change it in
launcher.py)
- Ensure FFmpeg is installed and accessible
- Check your internet connection
- Verify the YouTube URL is valid
- Check server console for error messages
- Ensure the server is running
- Verify IP address matches in both
launcher.pyandindex.js - Check browser console for specific error messages
- Video downloads should be MP4 format
- Audio downloads should be MP3 format
- If issues persist, check FFmpeg installation
uvicorn download:app --host 172.22.112.1 --port 2847 --reloadTest the server by visiting: http://172.22.112.1:2847/docs to see the FastAPI documentation.
See requirements.txt for full list:
fastapi- Web frameworkuvicorn- ASGI serveryt-dlp- YouTube downloaderpydantic- Data validation
This project is provided as-is for personal use.
Feel free to fork and modify for your own use. Suggestions and improvements are welcome!
- Downloaded files are temporarily stored in the
downloads/directory - Files are automatically cleaned up after being served
- The server must be running for the application to work
- Network access allows other devices on your network to use the downloader
For issues or questions:
- Check the troubleshooting section
- Review server console output for errors
- Check browser console for frontend errors
Enjoy downloading your favorite YouTube content! π