From 5d8caf4d244c06fbfc66fdf9e1b19a42ffc979d5 Mon Sep 17 00:00:00 2001 From: dsc Date: Thu, 31 Aug 2023 04:11:11 +0300 Subject: [PATCH] support multiple streams --- ircradio/radio.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ircradio/radio.py b/ircradio/radio.py index 5b671b0..37351eb 100644 --- a/ircradio/radio.py +++ b/ircradio/radio.py @@ -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)