Merge pull request #1047 from paddatrapper/listener-stats

Correctly encode icecast admin credentials for listener stats
This commit is contained in:
Robb 2020-05-23 09:43:52 -04:00 committed by GitHub
commit 16bff4ff9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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.