Giter Club home page Giter Club logo

asmsafone / radioplayerv3 Goto Github PK

View Code? Open in Web Editor NEW
463.0 6.0 867.0 120 KB

An Advanced Telegram Bot to Play Radio & Music in Voice Chat. This is Also The Source Code of The Bot Which is Being Used For Playing Radio in @AsmSafone Channel ❤️ https://radiostay.com - over 100000 online radio stations around the world

License: GNU Affero General Public License v3.0

Python 99.04% Dockerfile 0.61% Shell 0.32% Procfile 0.03%
radio music music-player bot tgvcbot telegram-radio-player radio-player music-player-bot telegram-bot radioplayer

radioplayerv3's Introduction

Telegram Radio Player V3 Mentioned in Awesome Telegram Calls

GitHub Repo stars GitHub forks GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub contributors GitHub repo size GitHub commit activity GitHub Bot Updates Bot Support

An Advanced 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 AsmSupport 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
  • Change Voice chat title to current playing song name
  • Automatically downloads audio for the first two tracks in the playlist to ensure smooth playing

Deploy to Heroku

NOTE: Change the app region to Europe (it will help to make the bot stable)

Deploy to Railway

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

Config Vars:

  1. API_ID : Get it from https://my.telegram.org/apps
  2. API_HASH : Get it from https://my.telegram.org/apps
  3. BOT_TOKEN : Get it from @Botfather XD
  4. SESSION_STRING : Generate from @genStr robot or genStr
  5. CHAT_ID : ID of Channel/Group where the bot plays Music/Radio.
  6. LOG_GROUP : ID of Group to send Playlist, if CHAT_ID is a Group.
  7. AUTH_USERS : ID of Auth Users who can use Admin commands. (for multiple users seperated by space)
  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 'True' If you want to make /play commands only for admins of CHAT. By default /play is available for all.
  12. HEROKU_API_KEY: Your Heroku api key. Get it from here
  13. HEROKU_APP_NAME: Name of your Heroku app if deploying to heroku.
  • Enable the worker after deploy the project to Heroku.
  • Bot will starts radio automatically in given CHAT_ID 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.
  • Telegram API Key
  • FFmpeg Python
  • Telegram String Session of the account.
  • User Accounts Needs To Be An Admin In The Channel or Group.
  • Must Start A Voice Chat In Channel/Group Before Running The Bot.

Run On VPS

$ git clone https://github.com/AsmSafone/RadioPlayerV3
$ cd RadioPlayerV3
$ sudo apt install git curl python3-pip ffmpeg -y
$ pip3 install -U pip
$ pip3 install -r requirements.txt
# <create .env variables appropriately>
$ python3 main.py

License

RadioPlayerV3, Telegram Voice Chat Bot
Copyright (c) 2021  Asm Safone <https://github.com/AsmSafone>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>

Credits

radioplayerv3's People

Contributors

asmsafone avatar log-afk-xd avatar reaprx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

radioplayerv3's Issues

GroupCallNotFoundError

Traceback (most recent call last):
File "main.py", line 28, in
from utils import mp, USERNAME, FFMPEG_PROCESSES
File "/root/RadioPlayerV3/utils.py", line 28, in
from pytgcalls.exceptions import GroupCallNotFoundError
ImportError: cannot import name 'GroupCallNotFoundError'

Python 3.6

Seems suspicious

One of the config vars is SESSION_STRING that can only be obtained via the some shady methods.
The one with @genStr_robot requires you to follow the developer's telegram channel (which is already kind of meh to be honest) and then asks you to give it your OTP which you shouldn't really tell anyone, they are very clear about that.
I'm not saying anything, I'm sure the dev is cool and not trying to scam people, but you can't deny that it seems very suspicious and thus I'd move away from this kind of setup.
Maybe there is a way around asking for the second most important thing about your telegram account, idk

Custom Audio Source

For now this bot only support Hardcode or embeded link of Radio Source . Sometimes this method make bot isn't usable when radio source or link are down , and command to play youtube music is doesnt work . so hope you can make it like /radio radiosourceurl like /play command

help me!

hi.
i join @AsmSafone voice chat and i see "connecting" and not hearing any sound.

binascii.Error: Invalid base64-encoded string: number of data characters

Any chance to start the bot?

ubuntu@azura:~/RadioPlayerV3$ python3 main.py Traceback (most recent call last): File "main.py", line 28, in <module> from utils import mp, USERNAME, FFMPEG_PROCESSES File "/home/ubuntu/RadioPlayerV3/utils.py", line 57, in <module> from user import USER File "/home/ubuntu/RadioPlayerV3/user.py", line 37, in <module> USER.start() File "/home/ubuntu/.local/lib/python3.8/site-packages/pyrogram/sync.py", line 66, in async_to_sync_wrap return loop.run_until_complete(coroutine) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/ubuntu/.local/lib/python3.8/site-packages/pyrogram/methods/utilities/start.py", line 52, in start is_authorized = await self.connect() File "/home/ubuntu/.local/lib/python3.8/site-packages/pyrogram/methods/auth/connect.py", line 39, in connect await self.load_session() File "/home/ubuntu/.local/lib/python3.8/site-packages/pyrogram/client.py", line 674, in load_session await self.storage.open() File "/home/ubuntu/.local/lib/python3.8/site-packages/pyrogram/storage/memory_storage.py", line 41, in open base64.urlsafe_b64decode( File "/usr/lib/python3.8/base64.py", line 133, in urlsafe_b64decode return b64decode(s) File "/usr/lib/python3.8/base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Invalid base64-encoded string: number of data characters (373) cannot be 1 more than a multiple of 4

Need Some Improvements

Bot should automatically leave if voice chat ended otherwise bot unable to login to the voice chat again.
Some times bot in mute status but i can see chat title updated with requested song.
Restart command not working,
Please add config to disable and enable the radio stream. (only player mode)

This is a very good bot ever i met...I love it

Issue Deploying to Heroku

When I am trying to deploy this radio player to heroku, I am getting this weird error, anybody have any solution?

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.