base64.b64encode(...) takes a byte array, not a string (spotify.py)

This commit is contained in:
jesopo 2019-01-29 22:37:44 +00:00
parent af7a765547
commit bb047ec1b7

View file

@ -19,7 +19,7 @@ class Module(ModuleManager.BaseModule):
client_id = self.bot.config["spotify-client-id"] client_id = self.bot.config["spotify-client-id"]
client_secret = self.bot.config["spotify-client-secret"] client_secret = self.bot.config["spotify-client-secret"]
bearer = "%s:%s" % (client_id, client_secret) bearer = "%s:%s" % (client_id, client_secret)
bearer = base64.b64encode(bearer).decode("utf8") bearer = base64.b64encode(bearer.encode("utf8")).decode("utf8")
page = utils.http.request(URL_TOKEN, method="POST", page = utils.http.request(URL_TOKEN, method="POST",
headers={"Authorization": "Basic %s" % bearer}, headers={"Authorization": "Basic %s" % bearer},