NOTE! THIS IS FULLY VIBE CODED! SORRY FOR THAT. I was trying to learn how api works and how to create one. errors and vulnerabilities is well expected. Thank you
SPARDOWN is a FastAPI-powered music search and download service that allows users to search tracks, fetch YouTube sources, download audio, convert to MP3, and manage download history through a REST API.
PLEASE READ : Local API Integration Guide
- Music Search
- YouTube Audio Downloads
- Automatic MP3 Conversion
- Metadata Tagging
- Download History
- Usage Statistics
- Background Job Queue
- API Key Authentication
- Rate Limiting
- Download Management
Client
│
▼
FastAPI API
│
▼
Job Queue
│
▼
YouTube Search
│
▼
yt-dlp
│
▼
FFmpeg Conversion
│
▼
MP3 Output
- Python 3.11+
- FFmpeg
- Git
git clone https://github.com/marpace1/SPARDOWN.git
cd SPARDOWNpython -m venv .venvWindows:
.venv\Scripts\activateLinux/Mac:
source .venv/bin/activateSPARDOWN can be run using Docker, eliminating the need to manually install Python dependencies, FFmpeg, or configure the runtime environment.
Install:
- Docker
- Docker Compose
Verify installation:
docker --version
docker compose versionCreate a .env file from the example:
cp .env.example .envEdit the values as needed.
docker compose buildThis will:
- Install Python dependencies
- Install FFmpeg
- Copy the SPARDOWN source code
- Create the application image
docker compose upOr run in the background:
docker compose up -dSwagger UI:
http://localhost:8000/docs
ReDoc:
http://localhost:8000/redoc
docker compose logs -fdocker compose downdocker compose down
docker compose build
docker compose up -dDownloaded files are stored in the local downloads directory and remain available even after the container is restarted.
Check logs:
docker compose logsChange the port mapping inside:
docker-compose.ymlExample:
ports:
- "8080:8000"Then access:
http://localhost:8080/docs
docker psYou should see the SPARDOWN container listed and running.
pip install -r requirements.txtCreate a .env file:
API_KEY=your_api_key
DATABASE_URL=sqlite:///spardown.db
DOWNLOAD_PATH=downloadsEnsure FFmpeg is available in PATH.
Verify:
ffmpeg -versionuvicorn main:app --reloadServer:
http://127.0.0.1:8000
Swagger Documentation:
http://127.0.0.1:8000/docs
ReDoc:
http://127.0.0.1:8000/redoc
Include API key:
X-API-Key: your_api_keyGET /api/search?q=alan walker faded{
"success": true,
"results": [
{
"title": "Alan Walker - Faded",
"artist": "Alan Walker",
"duration": 212
}
]
}POST /api/download{
"query": "Alan Walker Faded"
}{
"job_id": "123456",
"status": "queued"
}GET /api/jobs/{job_id}{
"job_id": "123456",
"status": "completed",
"progress": 100
}GET /api/downloads/{file_id}Returns MP3 file.
GET /api/history{
"downloads": [
{
"title": "Alan Walker - Faded",
"downloaded_at": "2026-06-14T18:30:00"
}
]
}GET /api/stats{
"total_downloads": 25,
"successful_downloads": 24,
"failed_downloads": 1
}SPARDOWN/
├── main.py
├── requirements.txt
├── README.md
├── downloads/
├── tests/
├── .env
├── spardown.db
└── SPARDOWN/
- Depends on YouTube availability.
- Search quality depends on source metadata.
- Very large playlists may take longer to process.
- Regional restrictions may affect some content.
- Download speed depends on network conditions.
- Playlist Downloads
- Album Downloads
- Bulk Downloads
- Better Metadata Matching
- WebSocket Progress Updates
- User Accounts
- Download Scheduling
- Desktop App (Tauri)
- Modern GUI
- Multi-platform Packaging
Contributions are welcome.
- Fork repository
- Create feature branch
- Commit changes
- Open pull request
MIT License
This project is intended for educational and personal use. Users are responsible for complying with applicable copyright laws and platform terms of service.