Skip to content
/ TuneViaBot Public template

🎶 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.

License

Notifications You must be signed in to change notification settings

CertifiedCoders/TuneViaBot

Repository files navigation

🌟 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

🌟 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

🔑 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.

Where do I get each key?
Key Where to Get It Steps Notes
API_ID & API_HASH my.telegram.orgAPI Development Tools 1) Log in with Telegram → 2) Open API Development Tools → 3) Create app → 4) Copy values Keep these private. Needed by both userbot & bot client.
BOT_TOKEN @BotFather 1) /newbot → 2) Set name & username → 3) Copy the token Rotate if leaked. Store in .env.
STRING_SESSION @SessionBuilderbot 1) Start bot → 2) Provide API_ID/API_HASH → 3) Complete login → 4) Copy string Userbot auth for Pyrogram.
LOGGER_ID Telegram Channel/Group you own 1) Create private channel/group → 2) Add your bot as admin → 3) Get ID via @AnnieXRobot or @MissRose_Bot Use a private space so logs aren’t public.
MONGO_DB_URI MongoDB Atlas 1) Create free cluster → 2) Add database user & IP allowlist → 3) Copy connection string (mongodb+srv://...) Required for persistence (queues, configs, etc.).
COOKIE_URL Any secure host (e.g., Pastebin, Batbin) 1) Upload your cookies.txt privately → 2) Set paste visibility to Unlisted → 3) Copy the raw URL Improves YouTube reliability. Never commit raw cookies.
API_KEY / API_URL or VIDEO_API_URL Provider of your choice generate key → paste here Optional integrations.

☕ VPS Setup Guide

Toggle VPS Steps

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

🐳 Docker Deployment

Toggle Docker Steps

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

☁️ Quick Deploy

Platform Deploy Link
🔑 Generate Session
🌍 Heroku Deploy

💬 Community & Support

🔖 Credits

About

🎶 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.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

Languages