Send query result to channel

This commit is contained in:
elpatron68
2019-07-27 18:18:07 +02:00
parent 92412bb29f
commit f62cb1afe4
3 changed files with 901 additions and 72 deletions

20
radiobrowser.py Normal file
View File

@ -0,0 +1,20 @@
from rbRadios import RadioBrowser
rb = RadioBrowser()
def getstations_byname(query):
results = rb.stations_byname(query)
stations = []
for st in results:
try:
url = rb.playable_station(st['id'])['url']
station = {'stationname': st['name'], 'url': url}
stations.append(station)
except:
pass
return stations
if __name__ == "__main__":
r = getstations_byname('r.sh')
pass