An open‑source Flask application for extracting and downloading audio and video from YouTube and hundreds of other supported platforms. Offers both a sleek web UI and a simple JSON API for easy integration into your own projects.
⚠️ Educational Purpose Only This repository is provided by Aticmatic purely for educational use. Respect all source site terms of service and fair use policies.
- 🚀 Fast extraction of available media formats using
yt-dlp. - 🎨 Responsive web interface built with TailwindCSS and Alpine.js.
- 🔑 API access with API key registration and rate limiting.
- 📊 Download stats (filesize, resolution, codecs, bitrates).
- 🔒 Security via request throttling and API key authentication.
- 📦 Persistent user tracking with Flask‑SQLAlchemy and MySQL (or MariaDB).
- Python 3.7 or higher
- MySQL or MariaDB server
yt-dlp
certifi
flask
humanize
Flask-SQLAlchemy
PyMySQL
email_validator
Flask-Limiter
-
Clone this repository
git clone https://github.com/AticMatic/Youtatic.git cd media-downloader -
Create & activate a virtual environment
python3 -m venv venv source venv/bin/activate -
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
Create a
.envfile in the project root with:FLASK_APP=main.py FLASK_ENV=development # or production DATABASE_URL=mysql+pymysql://<user>:<pass>@<host>/<database> SECRET_KEY=your-secret-key
-
Initialize the database
flask db upgrade # if using migrations, or python -c "from main import db; db.create_all()"
-
Run the server
flask run --host 0.0.0.0 --port 5000
Then visit http://localhost:5000 in your browser.
- Paste any supported media URL in the input field.
- Click "Find Download Options".
- Browse and download your desired format.
-
Register for an API key:
curl -X POST http://localhost:5000/register_api_user \ -d "[email protected]" -d "phone=+1234567890"
Response:
{ "success": true, "email": "[email protected]", "api_key": "YOUR-API-KEY" } -
Fetch formats:
curl -G http://localhost:5000/api/v1/formats \ -H "X-API-Key: YOUR-API-KEY" \ --data-urlencode "url=https://youtu.be/abc123"
Sample response:
{ "success": true, "data": { "title": "Video Title", "original_url": "https://youtu.be/abc123", "formats": [ /* array of format objects */ ] } } -
Error format:
{ "success": false, "error": "Description of error" }
- Rate limiting per IP or per API key is enforced via
Flask-Limiter. - Adjust limits in the application configuration (see
main.py).
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m "Add feature"\) - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
Please keep PRs focused and write clear commit messages.
This project is released under the MIT License. See LICENSE for details.
Provided by Aticmatic for educational purposes only.