From de1f3d9df53d72c4810d65475b226d5c335b0832 Mon Sep 17 00:00:00 2001 From: elpatron68 Date: Sat, 27 Jul 2019 22:16:11 +0200 Subject: [PATCH] add homepage and image --- mumbleBot.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mumbleBot.py b/mumbleBot.py index 5a304ae..038d097 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -395,9 +395,14 @@ class MumbleBot: stationname = rstation[0]['name'] country = rstation[0]['country'] codec = rstation[0]['codec'] - bitrate = rstation[0]['bitrate'] - msg = f'Start playing radio station: {stationname} from {country} ({codec}/{bitrate} kbit)' - logging.info(' Play radio station ' + msg) + bitrate = rstation[0]['bitrate'] + genre = rstation[0]['tags'] + imageurl = rstation[0]['favicon'] + homepage = rstation[0]['homepage'] + msg = f'Start playing radio station: {stationname} ({codec}/{bitrate} kbit, country: {country}, genre: {genre})' + if homepage and imageurl: + msg += f'' + logging.debug(f'Play radio station {stationname}') self.send_msg(msg, text) url = radiobrowser.geturl_byid(parameter) if url != "-1":