Skip to content

jsjsksk83896/TgMusicBot

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

146 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TgMusicBot - Telegram Music Bot

Telegram Group Calls Streaming bot with some useful features, written in Python with Py-Tgcalls. Supporting platforms like YouTube, Spotify, Apple Music, Soundcloud, JioSaavn and more.

Stars Forks Last Commit Repo Size Python License Issues PRs CI Status

thumbnail

@FallenBeatzBot - Try it now!


๐Ÿšซ Tired of IP Bans from YouTube?

Say goodbye to restrictions with our Premium Music API โ€“ your ultimate solution for seamless, high-quality downloads.

  • Easy Integration โ€“ Just set API_URL & API_KEY variables in your bot configuration.
  • High-Quality Downloads โ€“ Get music from Spotify, SoundCloud, and YouTube in top quality.

๐Ÿ“ฉ Contact me on Telegram to get access or use @FallenApiBot


Want to use cookies?

๐Ÿ“˜ Check out this guide for instructions on downloading and using them.


Features

  • Multi-Platform Support - Play music from Spotify, YT-Music, YouTube, JioSaavn, Apple Music, SoundCloud and Telegram files.
  • Playlists & Queue - Seamless music playback with queue management.
  • Full Playback Controls - Skip, Pause, Resume, End, Mute, Unmute, Volume, Loop, Seek.
  • Group Voice Chats - Supports Telegram group voice chats (requires admin permissions).
  • Optimized Performance - Fully async, efficient, and lightweight.
  • Easy Deployment - Pre-configured Docker setup.
  • Multi-Language Support - Available in English, Hindi, Spanish, Arabic, and more. Easily extendable with your own translations.
  • Open-Source & Free - Built from scratch using PyTdBot & PyTgCalls.

    ๐Ÿ’ก Prefer using Pyrogram instead of PyTdBot? Check out the Pyro-Branch.


Installation

Dependency Tree: Click to expand
tgmusicbot v1.2.1
โ”œโ”€โ”€ aiofiles v24.1.0
โ”œโ”€โ”€ apscheduler v3.11.0
โ”‚   โ””โ”€โ”€ tzlocal v5.3.1
โ”œโ”€โ”€ cachetools v6.0.0
โ”œโ”€โ”€ kurigram v2.2.4
โ”‚   โ”œโ”€โ”€ pyaes v1.6.1
โ”‚   โ””โ”€โ”€ pysocks v1.7.1
โ”œโ”€โ”€ meval v2.5
โ”œโ”€โ”€ ntgcalls v2.0.0
โ”œโ”€โ”€ pillow v11.2.1
โ”œโ”€โ”€ psutil v7.0.0
โ”œโ”€โ”€ py-tgcalls v2.2.0
โ”‚   โ”œโ”€โ”€ aiohttp v3.12.6
โ”‚   โ”‚   โ”œโ”€โ”€ aiohappyeyeballs v2.6.1
โ”‚   โ”‚   โ”œโ”€โ”€ aiosignal v1.3.2
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ frozenlist v1.6.0
โ”‚   โ”‚   โ”œโ”€โ”€ attrs v25.3.0
โ”‚   โ”‚   โ”œโ”€โ”€ frozenlist v1.6.0
โ”‚   โ”‚   โ”œโ”€โ”€ multidict v6.4.4
โ”‚   โ”‚   โ”œโ”€โ”€ propcache v0.3.1
โ”‚   โ”‚   โ””โ”€โ”€ yarl v1.20.0
โ”‚   โ”‚       โ”œโ”€โ”€ idna v3.10
โ”‚   โ”‚       โ”œโ”€โ”€ multidict v6.4.4
โ”‚   โ”‚       โ””โ”€โ”€ propcache v0.3.1
โ”‚   โ”œโ”€โ”€ deprecation v2.1.0
โ”‚   โ”‚   โ””โ”€โ”€ packaging v25.0
โ”‚   โ””โ”€โ”€ ntgcalls v2.0.0
โ”œโ”€โ”€ py-yt-search v0.3
โ”‚   โ”œโ”€โ”€ httpx v0.28.1
โ”‚   โ”‚   โ”œโ”€โ”€ anyio v4.9.0
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ idna v3.10
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ sniffio v1.3.1
โ”‚   โ”‚   โ”œโ”€โ”€ certifi v2025.4.26
โ”‚   โ”‚   โ”œโ”€โ”€ httpcore v1.0.9
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ certifi v2025.4.26
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ h11 v0.16.0
โ”‚   โ”‚   โ””โ”€โ”€ idna v3.10
โ”‚   โ””โ”€โ”€ python-dotenv v1.1.0
โ”œโ”€โ”€ pycryptodome v3.23.0
โ”œโ”€โ”€ pydantic v2.11.5
โ”‚   โ”œโ”€โ”€ annotated-types v0.7.0
โ”‚   โ”œโ”€โ”€ pydantic-core v2.33.2
โ”‚   โ”‚   โ””โ”€โ”€ typing-extensions v4.13.2
โ”‚   โ”œโ”€โ”€ typing-extensions v4.13.2
โ”‚   โ””โ”€โ”€ typing-inspection v0.4.1
โ”‚       โ””โ”€โ”€ typing-extensions v4.13.2
โ”œโ”€โ”€ pymongo v4.13.0
โ”‚   โ””โ”€โ”€ dnspython v2.7.0
โ”œโ”€โ”€ pytdbot v0.9.3
โ”‚   โ”œโ”€โ”€ aio-pika v9.5.5
โ”‚   โ”‚   โ”œโ”€โ”€ aiormq v6.8.1
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ pamqp v3.3.0
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ yarl v1.20.0 (*)
โ”‚   โ”‚   โ”œโ”€โ”€ exceptiongroup v1.3.0
โ”‚   โ”‚   โ””โ”€โ”€ yarl v1.20.0 (*)
โ”‚   โ””โ”€โ”€ deepdiff v8.5.0
โ”‚       โ””โ”€โ”€ orderly-set v5.4.1
โ”œโ”€โ”€ pytgcrypto v1.2.11
โ”œโ”€โ”€ python-dotenv v1.1.0
โ”œโ”€โ”€ pytz v2025.2
โ”œโ”€โ”€ tdjson v1.8.49
โ”œโ”€โ”€ ujson v5.10.0
โ”œโ”€โ”€ yt-dlp v2025.5.22
โ”œโ”€โ”€ black v25.1.0 (extra: dev)
โ”‚   โ”œโ”€โ”€ click v8.2.1
โ”‚   โ”œโ”€โ”€ mypy-extensions v1.1.0
โ”‚   โ”œโ”€โ”€ packaging v25.0
โ”‚   โ”œโ”€โ”€ pathspec v0.12.1
โ”‚   โ””โ”€โ”€ platformdirs v4.3.8
โ”œโ”€โ”€ ruff v0.11.12 (extra: dev)
โ””โ”€โ”€ setuptools v78.1.1 (extra: dev)
๐Ÿ“Œ Docker Installation (Recommended) (Click to expand)

๐Ÿณ Prerequisites

  1. Install Docker:

๐Ÿš€ Quick Setup

  1. Clone the repository:
    git clone https://github.com/AshokShau/TgMusicBot.git && cd TgMusicBot

๐Ÿ”ง Configuration

  1. Prepare environment file:

    cp sample.env .env
  2. Edit configuration (choose one method):

    • Beginner-friendly (nano):

      nano .env
      • Edit values
      • Save: Ctrl+O โ†’ Enter โ†’ Ctrl+X
    • Advanced (vim):

      vi .env
      • Press i to edit
      • Save: Esc โ†’ :wq โ†’ Enter

๐Ÿ—๏ธ Build & Run

  1. Build Docker image:

    docker build -t tgmusicbot .
  2. Run container (auto-restarts on crash/reboot):

    docker run -d \
      --name tgmusicbot \
      --env-file .env \
      --restart unless-stopped \
      tgmusicbot

๐Ÿ” Monitoring

  1. Check logs:
    docker logs -f tgmusicbot
    (Exit with Ctrl+C)

โš™๏ธ Management Commands

  • Stop container:

    docker stop tgmusicbot
  • Start container:

    docker start tgmusicbot
  • Update the bot:

    docker stop tgmusicbot
    docker rm tgmusicbot
    git pull origin master
    docker build -t tgmusicbot .
    docker run -d --name tgmusicbot --env-file .env --restart unless-stopped tgmusicbot
๐Ÿ“Œ Step-by-Step Installation Guide (Click to Expand)

๐Ÿ› ๏ธ System Preparation

  1. Update your system (Recommended):

    sudo apt-get update && sudo apt-get upgrade -y
  2. Install essential tools:

    sudo apt-get install git python3-pip ffmpeg tmux -y

โšก Quick Setup

  1. Install UV package manager:

    pip3 install uv
  2. Clone the repository:

    git clone https://github.com/AshokShau/TgMusicBot.git && cd TgMusicBot

๐Ÿ Python Environment

  1. Create virtual environment:

    uv venv
  2. Activate environment:

    • Linux/Mac: source .venv/bin/activate
    • Windows (PowerShell): .\.venv\Scripts\activate
  3. Install dependencies:

    uv pip install -e .

๐Ÿ” Configuration

  1. Setup environment file:

    cp sample.env .env
  2. Edit configuration (Choose one method):

    • For beginners (nano editor):

      nano .env
      • Edit values
      • Save: Ctrl+O โ†’ Enter โ†’ Ctrl+X
    • For advanced users (vim):

      vi .env
      • Press i to edit
      • Save: Esc โ†’ :wq โ†’ Enter

๐Ÿค– Running the Bot

  1. Start in tmux session (keeps running after logout):

    tmux new -s musicbot
    tgmusic

    Tmux Cheatsheet:

    • Detach: Ctrl+B then D
    • Reattach: tmux attach -t musicbot
    • Kill session: tmux kill-session -t musicbot

๐Ÿ”„ After Updates

To restart the bot:

tmux attach -t musicbot
# Kill with Ctrl+C
tgmusic
Deploy on Heroku, Railway(Click to expand)
Deploy on Heroku Deploy on Railway

Configuration

๐Ÿ“Œ Environment Variables (Click to expand)

๐Ÿ”‘ Required Variables

๐Ÿ”— String Sessions

  • STRING1 - Pyrogram String Session, STRING2 ... STRING10

Get from @StringFatherBot

๐Ÿ› ๏ธ Additional Configuration

  • OWNER_ID โ€“ Your Telegram User ID
  • MONGO_URI โ€“ Get from MongoDB Cloud
  • API_URL โ€“ Get from @FallenApiBot (API for unlimited downloads)
  • API_KEY โ€“ Required for API_URL
  • DOWNLOADS_DIR โ€“ Directory for downloads and TDLib database
  • SUPPORT_GROUP โ€“ Support Group Link
  • SUPPORT_CHANNEL โ€“ Support Channel Link
  • IGNORE_BACKGROUND_UPDATES โ€“ Ignore background updates
  • LOGGER_ID โ€“ Log Group ID
  • AUTO_LEAVE โ€“ Leave all chats for all userbot clients.
  • MIN_MEMBER_COUNT โ€“ Minimum number of members required for the bot to stay in a group.

๐ŸŽต Music Download Options

  • PROXY โ€“ Optional; Proxy URL for yt-dlp
  • DEFAULT_SERVICE โ€“ Default search platform (Options: youtube, spotify, jiosaavn)
  • DOWNLOADS_DIR โ€“ Directory for downloads and TDLib database

๐Ÿช Cookies

  • COOKIES_URL โ€“ URLs for downloading cookies (More info here)

๐ŸŽฎ Usage

  1. Add @FallenBeatzBot to a group and grant admin permissions.
  2. Use /start to initialize the bot.
  3. Use /help to view the list of available commands.

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Make meaningful changes โ€“ improve features, fix bugs, or optimize performance.
  3. Submit a pull request with a clear explanation of your changes.

๐Ÿ”น Avoid submitting minor PRs for small typos or README tweaks unless they significantly improve clarity.


License

This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.


Credits

  • AshokShau - Creator & Maintainer
  • Thanks to all contributors & bug hunters for improving the project!
  • Special thanks to PyTgCalls for their outstanding work.

๐Ÿ’– Support the Project

Love TgMusicBot? Help keep it running!

๐Ÿ’ฐ Donate via Crypto, PayPal, or UPI โ€“ Contact me on Telegram for details.

Every contribution helps! โค๏ธ


๐Ÿ”— Links

Follow me on GitHub for updates.
Star the repository on GitHub to support the project.

๐Ÿ“ข Join our Telegram community:
Telegram Group
Telegram Channel

About

Telegram Group Calls Streaming bot with some useful features, written in Python with Py-Tgcalls. Supporting platforms like YouTube, Spotify, AppleMusic, Soundcloud, JioSaavn and more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.6%
  • Shell 2.3%
  • Other 0.1%