support multiple streams

This commit is contained in:
dsc 2023-08-31 04:11:11 +03:00
parent 1cf5b0e79a
commit 5d8caf4d24

View file

@ -150,6 +150,8 @@ class Radio:
@staticmethod
async def listeners():
data: dict = await Radio.get_icecast_metadata()
if isinstance(data, list):
data = next(s for s in data if s['server_name'].endswith('wow.ogg'))
if not data:
return 0
return data.get('listeners', 0)