add homepage and image

This commit is contained in:
elpatron68
2019-07-27 22:16:11 +02:00
parent 4e1e59951e
commit de1f3d9df5

View File

@ -395,9 +395,14 @@ class MumbleBot:
stationname = rstation[0]['name'] stationname = rstation[0]['name']
country = rstation[0]['country'] country = rstation[0]['country']
codec = rstation[0]['codec'] codec = rstation[0]['codec']
bitrate = rstation[0]['bitrate'] bitrate = rstation[0]['bitrate']
msg = f'Start playing radio station: {stationname} from {country} ({codec}/{bitrate} kbit)' genre = rstation[0]['tags']
logging.info(' Play radio station ' + msg) 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'<a href="{homepage}"><img src="{imageurl}"></a>'
logging.debug(f'Play radio station {stationname}')
self.send_msg(msg, text) self.send_msg(msg, text)
url = radiobrowser.geturl_byid(parameter) url = radiobrowser.geturl_byid(parameter)
if url != "-1": if url != "-1":