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
This commit is contained in:
Terry Geng
2020-02-25 02:17:02 +08:00
committed by GitHub
parent 951934602e
commit 97f2326d9b
13 changed files with 1684 additions and 835 deletions

126
configuration.example.ini Normal file
View File

@ -0,0 +1,126 @@
# ========================================================
# botamusique Example Configuration File
# Version 6
# ========================================================
# Rename this file into configuration.ini after editing.
# Uncomment lines you needed, and carefully follow the
# instructions.
# ========================================================
# [server] section tells the bot how to connect to your murmur server.
[server]
host = 127.0.0.1
port = 64738
#password =
#channel =
#tokens = token1,token2
#certificate =
# [bot] section stores some basic settings of the behavior of the bot.
[bot]
# 'username' is the user name of the bot.
# 'comment' is the comment displayed by the bot.
#username = botamusique
#comment = Hi, I'm here to play radio, local music or youtube/soundcloud music. Have fun!
# 'volume' is default volume from 0 to 1.
#volume = 0.1
# 'admin': Users allowed to kill the bot, or ban URLs. Separated by ';'
#admin = User1;User2;
# 'music_folder': Folder that stores your local songs.
#music_folder = music_folder/
# 'tmp_folder': Folder that stores the downloaded music.
# 'tmp_folder_max_size': in MB, 0 for no cache, -1 for unlimited size
# 'ignored_folders', 'ignored_files': files and folders that would be ignored during scanning.
#tmp_folder = /tmp/
#tmp_folder_max_size = 10
#ignored_folders = tmp
#ignored_files = Thumbs.db
# 'auto_check_update': check for updates every time the bot starts
#auto_check_update = True
#pip3_path = venv/bin/pip
# 'logfile': write logs into this file.
#logfile =
#announce_current_music = True
#allow_other_channel_message = False
#allow_private_message = True
# 'save_playlist': If save_playlist is set True, the bot will save current
# playlist before quitting and reload it the next time it start.
#save_playlist = True
# 'max_track_playlist': Maximum track played when a playlist is added.
#max_track_playlist = 20
# 'max_track_duration': Maximum music duration (minutes)
#max_track_duration = 60
# 'ducking': If ducking is enabled, the bot will automatically attenuate its
# volume when someone is talking.
#ducking = False
#ducking_volume = 0.05
#ducking_threshold = 3000
# [webinterface] stores settings related to the web interface.
[webinterface]
# 'enable': Set 'enabled' to True if you'd like to use the web interface to manage
# your playlist, upload files, etc.
# The web interface is disable by default for security and performance reason.
#enabled = False
#listening_addr = 127.0.0.1
#listening_port = 8181
#is_web_proxified = True
# 'required_auth': Set this to True to enable password protection for the web interface.
#require_auth = False
#user =
#password =
# [debug] stores some debug settings.
[debug]
# 'ffmpeg': Set ffmpeg to True if you want to display DEBUG level log of ffmpeg.
#ffmpeg = False
#mumbleConnection = False
# [radio] is a list of default radio stations.
[radio]
#ponyville = http://192.99.131.205:8000/stream.mp3 "Here a command of !radio comment"
#luna = http://radio.ponyvillelive.com:8002/stream "calm and orchestra music"
#radiobrony = http://62.210.138.34:8000/live "Borny music of a friend"
#celestiaradio = http://celestia.aiverse.org:8000/mp3_256
#jazz = http://jazz-wr04.ice.infomaniak.ch/jazz-wr04-128.mp3 "Jazz Yeah !"
# [commands] is settings related to user command sent via mumble message.
[commands]
# 'command_symbol' is a list of characters the bot recognizes as command prefix.
#command_symbol = !:
# 'split_username_at_space': This option split username, in case you use such kind of mumo plugins https://wiki.mumble.info/wiki/Mumo#Set_Status
#split_username_at_space = False
# You may also customize commands recognized by the bot. For a full list of commands,
# see configuration.default.ini. Copy options you want to edit into this file.
#play_file = file, f
#play_file_match = filematch, fm
# [strings] is used to compose what the bot says. You can customize them to fit in
# the style of your channel, or translate into your own language.
# For a full list of strings, please see configuration.default.ini.
# Copy options you want to edit into this file.
# Note: please keep those {placeholder} of each string in your new string.
[strings]
# Some examples are:
#current_volume = Current volume: {volume}
#current_volume = 当前音量为{volume}
#current_volume = よく聞いてね!今の音量は{volume}<br />ちゃんと覚える:大音量で耳が悪くなる!
#
#bad_command = {command}: command not found
#bad_command = {command}: 未知命令,键入'!help'以获取可用命令列表
#bad_command = {command}がなに?食べれる?おいしいでしか?