Terry Geng 97f2326d9b Add more controls (#71)
* add more ducking command

* fix current music command

* provide more controls, like pause, resume, clear.

* add more controls in the web interface

* refactored and improved:
1. move get_music_tag_info to util, and
2. refined logic related to it.
3. now playlist will check for tag info thus update_music_tag_info is
useless and was removed
4. add "add folder" feature to !file asked in #65,
5. fix bugs related to !file

* truncate file list if too long

* fixed several tiny bugs

* fixed several tiny bugs continue

* fixed several tiny bugs continue continue

* fixed several tiny bugs continue**3

* fixed several tiny bugs continue**4

* added !filematch command to add files that match a regex pattern.

* truncate long message

* fix web interface delete file issue

* refresh after delete file

* add regex to listfile command

* refactored command part, added partial match support for commands

* organized

* added random command

* typo

* typo

* Fixed many bugs.

* Added workaround for azlux/pymumble#44 to fix the memory leak.

* changed logging style.

* fixed bugs related to random and resume

* fix now playing

* fixed issue related to download

* fixed issue related to download 2

* fixed thumbnail issue

* fixed add url problem in web interface

* REFACTORED, turned db.ini into sqlite3 database.

* fixed remove song problem

* fixed radio get title problem. auto download if tmp file is deleted

* fixed current index not loaded from database

* fixed: order of songs loaded from the database

* fixed: some obscure bugs. beautified error of commands

* added a workaround for TerryGeng/botamusique#1.

* beautified

* fixed: channel not loaded in the config

* fixed: auto checked for updates

* fixed: mysterious bug: sometimes "now playing" string cannot be properly
displayed.
The real reason is: do use <br />, do not use <br>. I tried hours to
find out this.

* chore: unified debug messages that refer to music items

* feav: fetch ffmpeg stderr mentioned in #72, reformatted logs.

* fix: async download not working

* fix: async download not working, still

* fix: async download not working, finished

* feat: queue command: ▶current playing item◀

* feat: support more than one command prefix

* chore: added some WARNINGs into default config file to avoid people to touch it.

* refactor: packed all string contants into constants.py, just to avoid people messing it around.

* refactor: required by azlux. Added a configuration.example.ini to keep people away from configuration.default.ini
2020-02-24 19:17:02 +01:00
2019-07-28 15:16:05 +02:00
2020-02-24 19:17:02 +01:00
2020-02-06 10:11:48 +08:00
2020-02-04 23:31:20 +08:00
2020-02-24 19:17:02 +01:00
2020-02-24 19:17:02 +01:00
2019-01-13 19:55:37 +01:00
2020-02-24 19:17:02 +01:00
2020-02-24 19:17:02 +01:00
2020-02-24 19:17:02 +01:00
2019-01-13 22:31:08 +01:00
2020-02-24 19:17:02 +01:00
2016-12-12 21:57:20 +01:00
2020-02-24 19:17:02 +01:00
2018-12-08 23:46:31 +01:00
2020-02-09 22:49:06 +08:00
2019-07-27 18:19:06 +02:00
2019-06-04 11:01:38 +02:00
2020-02-24 19:17:02 +01:00

botamusique

Botamusique is a mumble bot who plays music on a mumble channel. Predicted functionalities will be those people would expect from any classic music player.

botamusique can play:

  • Radio stations from url
  • Radio stations from http://www.radio-browser.info API (query from > 24k stations)
  • Youtube/Soundcloud URL (everything supported by youtube-dl)
  • Music in local folders (which can be uploaded through a web interface)

Menu

  1. Web Interface
  2. Installation
  3. Update
  4. Generate a certificate
  5. Starting the bot
  6. Custom commands
  7. Known issues
  8. Contributors

Web interface

Disabled by default. You need to enable it in configuration.ini. It works, and we are still making it better.

You need to create a folder for all your songs. Organize your songs by subfolder. The main folder needs to be set in configuration.ini (with a '/' at the end).

Installation

  1. You need python3 with opuslib and protobuf (look at the requirement of pymumble).
  2. The Bot uses ffmpeg, so you know what you have to do if ffmpeg isn't in your package manager. I personally use this repository on my raspberry.

To install botamusique (recommended, stable and with build-in auto-update support):

curl -Lo botamusique.tar.gz https://azlux.fr/botamusique/sources.tar.gz
tar -xzf botamusique.tar.gz
cd botamusique
python3 -m venv venv
venv/bin/pip install wheel
venv/bin/pip install -r requirements.txt

For the version of the master branch, you can use Git installation commands (no build-in auto-update support):

apt install python3-venv ffmpeg libjpeg-dev zlibc zlib1g zlib1g-dev
git clone --recurse-submodules https://github.com/azlux/botamusique.git
cd botamusique
python3 -m venv venv
venv/bin/pip install wheel
venv/bin/pip install -r requirements.txt

Update

If using the recommended install, you can send !update to the bot (command by default).

If using git, you need to update manually:

git pull --all
git submodule update
venv/bin/pip install --upgrade -r requirements.txt

(Optional) Generate a certificate

$ openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout botamusique.pem -out botamusique.pem -subj "/CN=botamusique"

Starting the bot

$ venv/bin/python mumbleBot.py -s HOST -u BOTNAME -P PASSWORD -p PORT -c CHANNEL -C /path/to/botamusique.pem

The bot listens the 8181 port so you should properly set the forwarding rules in you NAT configuration to let other peoples access the web interface. (DISABLED)

If you want information about autoStart and auto-Restart the bot, you can have help on the wiki.

Configuration

You can copy the file configuration.default.ini into configuration.ini and customize all variable. Everything can be changed but don't remove the default file.

Sections explained:

  • server: configuration about the server and bot name. This is overridden by the ./mumbleBot.py parameters.
  • bot: basic configuration of the bot, eg. comment, folder, default volume, etc.
  • webinterface: basic configuration about the interface (disabled by default)
  • command: you can customize the command you want for each action (if you put help = helpme , the bot will respond to !helpme )
  • radio: here you can provide a list of default radio ( I can play a jazz radio with the command !radio jazz)
  • strings: you can customize all string the bot can say.
  • debug: option to activate ffmpeg or pymumble debug. (Can be very verbose)

Known Issues

During installation, you may encounter the following error:

ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

You need to install a missing library: apt install libtiff5


In the beginning, you may encounter the following error even if you have installed all requirements:

Exception: Could not find opus library. Make sure it is installed.

You need to install the opus codec (not embedded in all system): apt install libopus0

Contributors

If you want to participate, You're welcome to fork and submit pull requests (fixes and new features).

The following people joined the collaborators for a faster development, big thanks:

  • @slipenbois
  • @mertkutay

Feel free to ask me if you want to help actively without using pull requests.

Description
Fork of botamusique
Readme MIT 5.1 MiB
Languages
Python 100%