diff --git a/spotiplayer_pi/api.py b/spotiplayer_pi/api.py index e951326..9d0ea11 100644 --- a/spotiplayer_pi/api.py +++ b/spotiplayer_pi/api.py @@ -62,7 +62,9 @@ class Api: timeout=timeout, ) req = res.json() - self.access_token = req["access_token"] + self.access_token = req.get("access_token", None) + # if None, refresh token has expired (180 days) + # TODO: need manual browser refresh, disable spoticlient 'till then self.header = {"Authorization": f"Bearer {self.access_token}"} return req["expires_in"] diff --git a/spotiplayer_pi/config.yaml b/spotiplayer_pi/config.yaml index f2d243d..ae91106 100644 --- a/spotiplayer_pi/config.yaml +++ b/spotiplayer_pi/config.yaml @@ -1,4 +1,4 @@ -refresh_token: "AQBGNOL-iocPZ_zxtr_sNXx4BZRaxPmg2Ea0cJGorcEu2IW2wSnLdkYDJpVDOuQQHWIQ-LjuNpBcY9PurPtdfPoT5ljXnGpso9CqX6n2alBXaYc767oKya_52qxqWPE0o7k" +refresh_token: "AQBdTpL8UOmfBcXeI8rd8Du_1YEnMnFU5n56eOEImHvrN3R510DGvak0SjeZ8SNspRWKjIGq53LZZqUhrGbCTlZg6ou91mptTsLuPCBXstQ3lNZTnrIbwZ-_0d9AOQZETJ8" base_64: "ZTI5Mzg3NWI3YWQ5NDQzZDg1NDMxYzkwOTEyZTdiMWQ6MjlmNDEzZTJiOTRlNGU0NDlkOWRiYmU0NmM2OTY5MTY=" api_interval: 3 # (float) number of seconds in-between API requests