A full-stack YouTube video downloader with a clean, modern interface. Paste any YouTube URL to get video details and download options in multiple formats.
- π₯ Video Preview: See video title, duration, and thumbnail before downloading
- πΉ Multiple Formats: Download videos in various MP4 qualities
- β‘ Fast Processing: Built with Django REST API and yt-dlp
- π± Responsive Design: Clean UI with Tailwind CSS v4
- οΏ½ Auto Cleanup: Downloaded files are automatically removed after 24 hours
- π‘οΈ Error Handling: Robust error handling for invalid URLs and network issues
Frontend:
- React 19 with Vite
- Tailwind CSS v4
- React Router DOM
Backend:
- Django 5.1.6 with Django REST Framework
- yt-dlp for video extraction
- CORS headers for cross-origin requests
- SQLite database
- Python 3.8+
- Node.js 16+
- npm or yarn
- Clone the repository
git clone https://github.com/elxecutor/elxtract.git
cd elxtract/backend
- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install Python dependencies
pip install django djangorestframework django-cors-headers yt-dlp python-dotenv
- Run migrations
python manage.py migrate
- Start the Django server
python manage.py runserver
- Navigate to frontend directory
cd ../frontend
- Install dependencies
npm install
- Start development server
npm run dev
If using VS Code, you can use the predefined tasks:
Ctrl+Shift+P
β "Tasks: Run Task" β "Run Django Backend"Ctrl+Shift+P
β "Tasks: Run Task" β "Run Vite Frontend"
- Start both servers (backend on :8000, frontend on :5173)
- Open your browser to
http://localhost:5173
- Paste a YouTube URL in the input field
- Click "Get Format" to see video details and available download options
- Choose your preferred format and click "Download"
https://www.youtube.com/watch?v=dQw4w9WgXcQ
https://youtu.be/jNQXAC9IVRw
Method | Endpoint | Description |
---|---|---|
POST | /api/formats/ |
Get video details and available formats |
POST | /api/download/ |
Download video in specified format |
POST | /api/cleanup/ |
Manual cleanup of old files |
Get video formats:
curl -X POST http://localhost:8000/api/formats/ \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'
Download video:
curl -X POST http://localhost:8000/api/download/ \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "format_id": "18"}'
Create a .env
file in the backend directory:
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=127.0.0.1,localhost
AUTO_CLEANUP_ENABLED=True
CLEANUP_DOWNLOADS_AFTER_HOURS=24
The frontend is configured to work with the backend on localhost:8000
. If you need to change this, update the API calls in src/components/Body.jsx
.
Backend not starting:
- Ensure Python virtual environment is activated
- Install missing dependencies:
pip install django djangorestframework django-cors-headers yt-dlp python-dotenv
- Run migrations:
python manage.py migrate
Frontend not loading:
- Clear npm cache:
npm cache clean --force
- Delete node_modules and reinstall:
rm -rf node_modules && npm install
- Check if port 5173 is available
CORS errors:
- Ensure django-cors-headers is installed and configured
- Check that frontend URL is allowed in Django settings
Download failures:
- Video might be private, restricted, or removed
- Try updating yt-dlp:
pip install --upgrade yt-dlp
- Check internet connection and firewall settings
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes and test thoroughly
- Commit your changes:
git commit -m "Add feature"
- Push to the branch:
git push origin feature-name
- Open a Pull Request
- Add audio-only download (MP3/M4A)
- Implement download progress tracking
- Add batch download functionality
- Create Docker containerization
- Add user authentication
- Implement download history
- Add dark mode toggle
This tool is for educational and personal use only. Please respect YouTube's Terms of Service and copyright laws. Users are responsible for ensuring they have the right to download content.
This project is licensed under the MIT License - see the LICENSE file for details.