From cdd9965a0f2b97aa276332cf3c621859f6ba68d6 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 23 Jan 2024 09:56:42 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Minor=20refactoring=20of?= =?UTF-8?q?=20login=20methods=20and=20namings.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/config.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py index 7c91e26..2557ae8 100644 --- a/tidal_dl_ng/config.py +++ b/tidal_dl_ng/config.py @@ -120,10 +120,7 @@ class Tidal(BaseConfig, metaclass=SingletonMeta): return result - def login_oauth_start(self, function=print) -> None: - self.session.login_oauth_simple(function) - - def login_finish(self) -> bool: + def _login_finalize(self) -> bool: result = self.session.check_login() if result: @@ -149,9 +146,12 @@ class Tidal(BaseConfig, metaclass=SingletonMeta): elif not is_token: fn_print("You either do not have a token or your token is invalid.") fn_print("No worries, we will handle this...") - self.login_pkce(fn_print) + # Login method: Device linking + # self.session.login_oauth_simple(fn_print) + # Login method: PKCE authorization (enables HiRes streaming) + self.session.login_pkce(fn_print) - is_login = self.login_finish() + is_login = self._login_finalize() if is_login: fn_print("The login was successful. I have stored your credentials (token).") @@ -161,6 +161,3 @@ class Tidal(BaseConfig, metaclass=SingletonMeta): fn_print("Something went wrong. Did you login using your browser correctly? May try again...") return result - - def login_pkce(self, fn_print: Callable) -> None: - self.session.login_pkce(fn_print)