add homepage and image
This commit is contained in:
11
mumbleBot.py
11
mumbleBot.py
@ -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":
|
||||||
|
Reference in New Issue
Block a user