TuneViaBot
πΆ A Powerful Telegram Music Bot Built with PyTgCalls and Pyrogram, TuneViaBot is a fast and reliable music player for Telegram groups and channels, streaming audio directly in Voice Chats (VCs). π§ Lag-free. Scalable. Easy to deploy.
Install / Use
/learn @CertifiedCoders/TuneViaBotREADME
π What is TuneViaBot?
TuneViaBot is a blazing fast, modern Telegram music bot built with Pyrogram and PyTgCalls. It streams high-quality music into your group voice chats and supports various platforms like YouTube, Spotify, Apple Music, and more.
π Features
<table> <tr> <td> <img src="https://files.catbox.moe/la0sxq.jpg" width="300" /> </td> <td>| π Feature | π Description | | ------------------------- | ------------------------------------------- | | πΆ HQ Music Streaming | Lagβfree HD audio in group voice chats | | π MultiβPlatform Sources | YouTube, Spotify, Apple Music, Resso, etc. | | β‘ Fast Setup | Oneβclick Heroku, VPS, or Docker deployment | | π Auto Config | Quick setup script with preβchecks |
</td> </tr> </table>π Environment Variables
Below are the required and optional environment variables for deployment.
API_ID= # Required - Get from https://my.telegram.org
API_HASH= # Required - From https://my.telegram.org
BOT_TOKEN= # Required - Get t.me/BotFather
OWNER_ID= # Required - Your Telegram user ID
LOGGER_ID= # Required - Log group/channel ID
STRING_SESSION= # Required - Generate from @SessionBuilderbot
MONGO_DB_URI= # Required - MongoDB connection string
COOKIE_URL= # Required - YT Cookies url
API_KEY= # Optional - External API key for song Download
VIDEO_API_URL= # Optional - External API url for video Download
API_URL= # Optional - External API url for audio Download
β οΈ Never expose raw cookies or tokens in public repos. Use safe paste services like Pastebin or Batbin.
<details> <summary><b>Where do I get each key?</b></summary> <!-- Added: Wellβorganized helper table --> <br/> <table> <thead> <tr> <th>Key</th> <th>Where to Get It</th> <th>Steps</th> <th>Notes</th> </tr> </thead> <tbody> <tr> <td><code>API_ID</code> & <code>API_HASH</code></td> <td><a href="https://my.telegram.org" target="_blank">my.telegram.org</a> β <i>API Development Tools</i></td> <td> 1) Log in with Telegram β 2) Open <b>API Development Tools</b> β 3) Create app β 4) Copy values </td> <td>Keep these private. Needed by both userbot & bot client.</td> </tr> <tr> <td><code>BOT_TOKEN</code></td> <td><a href="https://t.me/BotFather" target="_blank">@BotFather</a></td> <td> 1) <b>/newbot</b> β 2) Set name & username β 3) Copy the token </td> <td>Rotate if leaked. Store in <code>.env</code>.</td> </tr> <tr> <td><code>STRING_SESSION</code></td> <td><a href="https://t.me/SessionBuilderbot" target="_blank">@SessionBuilderbot</a></td> <td> 1) Start bot β 2) Provide <code>API_ID</code>/<code>API_HASH</code> β 3) Complete login β 4) Copy string </td> <td>Userbot auth for Pyrogram.</td> </tr> <tr> <td><code>LOGGER_ID</code></td> <td>Telegram <b>Channel/Group</b> you own</td> <td> 1) Create private channel/group β 2) Add your bot as admin β 3) Get ID via <code>@AnnieXRobot</code> or <code>@MissRose_Bot</code> </td> <td>Use a private space so logs arenβt public.</td> </tr> <tr> <td><code>MONGO_DB_URI</code></td> <td><a href="https://www.mongodb.com/atlas/database" target="_blank">MongoDB Atlas</a></td> <td> 1) Create free cluster β 2) Add database user & IP allowlist β 3) Copy connection string (<code>mongodb+srv://...</code>) </td> <td>Required for persistence (queues, configs, etc.).</td> </tr> <tr> <td><code>COOKIE_URL</code></td> <td>Any secure host (e.g., <a href="https://pastebin.com" target="_blank">Pastebin</a>, <a href="https://batbin.me" target="_blank">Batbin</a>)</td> <td> 1) Upload your <code>cookies.txt</code> privately β 2) Set paste visibility to <b>Unlisted</b> β 3) Copy the <b>raw</b> URL </td> <td>Improves YouTube reliability. Never commit raw cookies.</td> </tr> <tr> <td><code>API_KEY</code> / <code>API_URL or VIDEO_API_URL</code></td> <td>Provider of your choice</td> <td>generate key β paste here</td> <td>Optional integrations.</td> </tr> </tbody> </table> <br/> </details>β VPS Setup Guide
<img src="https://img.shields.io/badge/Show%20/Hide-VPS%20Steps-0ea5e9?style=for-the-badge" alt="Toggle VPS Steps"/> <div align="left"> <details>π΅ Deploy TuneViaBot on VPS
# Step 1: Update & Install Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl python3-pip python3-venv ffmpeg unzip tmux
# Step 2: Install Deno (for yt-dlp) β
curl -fsSL https://deno.land/install.sh | sh
# β When prompted: "Edit shell configs to add deno to the PATH? (y/n)" β Type: y
source ~/.bashrc
# Step 3: Clone & Setup
git clone https://github.com/CertifiedCoders/TuneViaBot
cd TuneViaBot
tmux new -s tune
# Inside tmux:
python3 -m venv venv
source venv/bin/activate
pip install -U pip && pip install -r requirements.txt
bash setup # Fill: API_ID, BOT_TOKEN, COOKIE_URL, etc.
bash start # Run bot
### Useful Commands
tmux detach # Use Ctrl+B, then D
tmux attach-session -t tune # Reattach session
tmux kill-session -t tune # Kill bot session
rm -rf TuneViaBot # Uninstall bot
</details>
</div>
π³ Docker Deployment
<img src="https://img.shields.io/badge/Show%20/Hide-Docker%20Steps-10b981?style=for-the-badge" alt="Toggle Docker Steps"/> <div align="left"> <details>### Step 1: Clone Repo
git clone https://github.com/CertifiedCoders/TuneViaBot
cd TuneViaBot
### Step 2: Create .env File
nano .env
# Paste your environment variables here (API_ID, API_HASH, BOT_TOKEN, MONGO_DB_URI, COOKIE_URL, etc.)
# Save with Ctrl+O, Enter, then Ctrl+X
### Step 3: Build Docker Image
docker build -t tuneviabot .
### Step 4: Run Container
docker run -d \
--name tune \
--env-file .env \
--restart unless-stopped \
tuneviabot
### Step 5: Manage Container
docker logs -f tune # View logs (Ctrl+C to exit)
docker stop tune # Stop container
docker start tune # Start container
docker rm -f tune # Remove container
docker rmi tuneviabot # Remove image
</details>
</div>
βοΈ Quick Deploy
| Platform | Deploy Link | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | π Generate Session | <a href="https://t.me/SessionBuilderbot"><img src="https://img.shields.io/badge/Session%20-Generator-blue?style=for-the-badge&logo=telegram"/></a> | | π Heroku Deploy | <a href="http://dashboard.heroku.com/new?template=https://github.com/CertifiedCoders/TuneViaBot"><img src="https://img.shields.io/badge/Deploy%20to-Heroku-purple?style=for-the-badge&logo=heroku"/></a> |
