A Telegram bot that searches and downloads audio, then sends a properly tagged MP3.
- Search YouTube by song name
- Download YouTube audio
- Download SoundCloud audio through the configured Cobalt instance
- Resolve Spotify track links through the Spotify Web API and download the matching YouTube source
- Write a portable
<song title>.mp3filename, ID3 metadata, source URL, and cover art - Fast response
- Clean and minimal interface
-
Clone the repository:
git clone https://github.com/Mak5er/z0music.git cd z0music -
Install dependencies:
pip install -r requirements.txt
-
Set up your Telegram bot token:
Create a .env file in the project root with the following content:
BOT_TOKEN=your_telegram_bot_token COBALT_API_URL=https://your-cobalt-instance.example COBALT_API_KEY=your-cobalt-api-key # Required only for Spotify track links SPOTIFY_CLIENT_ID=your-spotify-client-id SPOTIFY_CLIENT_SECRET=your-spotify-client-secret SPOTIFY_MARKET=UA
Create the Spotify values in the Spotify Developer Dashboard. The current implementation accepts Spotify track links. Album and playlist links are reserved for a later batch-download flow.
-
Run the bot using:
python main.py
-
OR Run with Docker:
docker compose up -d --build
├── main.py
├── handlers/
│ └── youtube.py
├── middlewares/
│ └── antiflood.py
├── services/
│ ├── audio.py
│ ├── cobalt.py
│ ├── spotify.py
│ └── youtube.py
├── downloads/
├── media/
│ └── z0music.png
├── requirements.txt
├── Dockerfile
└── docker-compose.yml
