# botamusique
-**Info:**
-
-> This is a fork of the official repository (located [here](https://github.com/azlux/botamusique)).
-We are working on various features for our own version of the bot. However, we will
-regularly merge upstream changes and will also create pull requests to merge back our
-features to the upstream repo at some point.
-
-The remainder of this readme is from the original repo.
-Note that the ToDo list at the end of the Readme is **outdated** and **not applicable** for this repository.
-
----
-
-[Version Française ici](README.fr.md)
-
======
Botamusique is a mumble bot which goal is to allow users to listen music together with its audio output.
multiple_matches = Track not found! Possible candidates:
queue_contents = The next items in the queue are:
queue_empty = No more music in the playlist!
+now_playing = Now playing %s<br />%s
help = Command available:
<br />!play_file <path>
import media
import logging
import util
+import base64
+from PIL import Image
+from io import BytesIO
+
class MumbleBot:
def __init__(self, args):
path, title = self.download_music(url)
var.current_music[1] = url
+ im = Image.open(var.config.get('bot', 'tmp_folder') + hashlib.md5(url.encode()).hexdigest() + '.jpg')
+ im.thumbnail((100, 100), Image.ANTIALIAS)
+ buffer = BytesIO()
+ im.save(buffer, format="JPEG")
+ thumbnail_base64 = base64.b64encode(buffer.getvalue())
+ thumbnail_html = '<img - src="data:image/PNG;base64,' + thumbnail_base64.decode() + '"/>'
+
+ logging.debug(thumbnail_html)
+ self.send_msg_channel(var.config.get('strings', 'now_playing') % (title, thumbnail_html))
+
elif var.current_music[0] == "file":
path = var.config.get('bot', 'music_folder') + var.current_music[1]
title = var.current_music[1]
'format': 'bestaudio/best',
'outtmpl': path,
'noplaylist': True,
+ 'writethumbnail': True,
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',