From b1f86ab22782bb2943a6b59e7abf47904fc924be Mon Sep 17 00:00:00 2001 From: RemixDev Date: Tue, 7 Dec 2021 11:37:26 +0100 Subject: [PATCH] Fixed issue when login is incorrect --- deezer/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deezer/__init__.py b/deezer/__init__.py index ba72fd5..4fe5c14 100644 --- a/deezer/__init__.py +++ b/deezer/__init__.py @@ -54,6 +54,9 @@ class Deezer: if child: child = int(child) # Check if user already logged in user_data = self.gw.get_user_data() + if not user_data or user_data and len(user_data.keys()) == 0: + self.logged_in = False + return False if user_data['USER']['USER_ID'] == 0: self.logged_in = False return False @@ -93,6 +96,9 @@ class Deezer: self.session.cookies.set_cookie(cookie_obj) user_data = self.gw.get_user_data() # Check if user logged in + if not user_data or user_data and len(user_data.keys()) == 0: + self.logged_in = False + return False if user_data["USER"]["USER_ID"] == 0: self.logged_in = False return False