RadioPlayer

Telegram Radio Player V3

An Telegram Bot to Play Nonstop Radio/Music/YouTube Live in Channel or Group Voice Chats.

This is also the source code of the bot which is being used for playing Radio in AsmSafone Channel & Music in SafoTheBot Group.

Special Features

  • Playlist, queue, 24x7 radio stream
  • Supports Live streaming from youtube
  • Starts Radio after if no songs in playlist
  • Automatic playback even if heroku restarts
  • Show current playing position of the audio
  • Control with buttons and commands
  • Download songs from youtube as audio
  • Automatically downloads audio for the first two tracks in the playlist to ensure smooth playing

Deploy to Heroku (The Easy Way)

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4465706c6f79253230546f2532304865726f6b752d626c756576696f6c65743f7374796c653d666f722d7468652d6261646765266c6f676f3d6865726f6b75

NOTE: Make Sure You Have Started A Voice Chat In Your Channel/Group Before Deploying!

Heroku Vars:

  1. API_ID : Get it from my.telegram.org
  2. API_HASH : Get it from my.telegram.org
  3. BOT_TOKEN : Get it from @Botfather
  4. SESSION_STRING : Generate from @genStr robot or genStr
  5. CHAT : ID of Channel/Group where the bot plays Music/Radio.
  6. LOG_GROUP : Group to send Playlist, if CHAT is a Group.
  7. ADMINS : ID of users who can use admin commands.
  8. STREAM_URL : Stream URL of radio station or a youtube live video to stream when the bot starts or with /radio command. Here is Some Live Streaming Links.
  9. MAXIMUM_DURATION : Maximum duration of song to play.(Optional)
  10. REPLY_MESSAGE : A reply to those who message the USER account in PM. Leave it blank if you do not need this feature.
  11. ADMIN_ONLY : Pass Y If you want to make /play commands only for admins of CHAT. By default /play is available for all.
  • Enable the worker after deploy the project to Heroku.
  • Bot will starts radio automatically in given CHAT with given STREAM_URL after deploy.
  • 24x7 Music even if heroku restarts, radio stream restarts automatically.
  • To play a song use /play as a reply to audio file or a youtube link or use /play [song name].
  • To download audio you can use @SafoneMusicBot or /song command to the bot.
  • Use /help to know about other commands & their usage.

Requirements

  • Python 3.6 or higher.
  • A
    Telegram API key
    and a Telegram account.
  • FFmpeg Python
  • Telegram String Session of the account.
  • Userbot Needs To Be Admin In The Channel or Group.
  • Must Start A Voice Chat In Channel/Group Before Running The Bot.

Run On VPS (The Hard Way)

$ git clone -b V3.0 https://github.com/AsmSafone/RadioPlayer
$ cd RadioPlayer
$ sudo apt-get install python3-pip ffmpeg
$ pip3 install -U pip
$ pip3 install -r requirements.txt
# <create variables appropriately>
$ python3 main.py

GitHub

https://github.com/AsmSafone/RadioPlayer