From f796182634b656c85bfe0565ad6932273ce7085d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 19 Aug 2019 19:08:44 +0200 Subject: [PATCH] Fix Spotify image failing in Python 3.5 In Python 3.5, `json.loads` accepts only `str`, not `bytes`. Fixes https://github.com/DocMarty84/koozic/issues/31 --- models/oomusic_spotify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/oomusic_spotify.py b/models/oomusic_spotify.py index 3f6cf82..4e27db6 100644 --- a/models/oomusic_spotify.py +++ b/models/oomusic_spotify.py @@ -138,7 +138,7 @@ def _get_token(self): if res.status_code != 200: _logger.info("Could not get Spotify token. Error code: %s", res.status_code) return "" - content = json.loads(res.content) + content = json.loads(res.content.decode("utf-8")) self.create( { "name": content["access_token"],