From cf414239e22832701ad931b606f16bf1421281cf Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Mon, 18 May 2020 16:49:19 +0200 Subject: [PATCH] Correctly encode icecast admin credentials for listener stats Fixes: #1045 --- python_apps/pypo/pypo/listenerstat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/pypo/listenerstat.py b/python_apps/pypo/pypo/listenerstat.py index e94c7f795..2d6371827 100644 --- a/python_apps/pypo/pypo/listenerstat.py +++ b/python_apps/pypo/pypo/listenerstat.py @@ -35,9 +35,10 @@ class ListenerStat(Thread): def get_stream_server_xml(self, ip, url, is_shoutcast=False): - encoded = base64.b64encode("%(admin_user)s:%(admin_pass)s" % ip) + auth_string = "%(admin_user)s:%(admin_pass)s" % ip + encoded = base64.b64encode(auth_string.encode('utf-8')) - header = {"Authorization":"Basic %s" % encoded} + header = {"Authorization":"Basic %s" % encoded.decode('ascii')} if is_shoutcast: #user agent is required for shoutcast auth, otherwise it returns 404.