If login fails token.json will be removed, so the user can have a fresh start. Fixes #197

This commit is contained in:
Robert Honz
2024-11-10 12:41:42 +01:00
parent ef2116f2b0
commit 913c88e65c
+9 -1
View File
@@ -125,8 +125,16 @@ class Tidal(BaseConfig, metaclass=SingletonMeta):
self.data.expiry_time,
is_pkce=do_pkce,
)
except HTTPError:
except (HTTPError, JSONDecodeError):
result = False
# Remove token file. Probably corrupt or invalid.
if os.path.exists(self.file_path):
os.remove(self.file_path)
print(
"Either there is something wrong with your credentials / account or some server problems on TIDALs "
"side. Anyway... Try to login again by re-starting this app."
)
return result