summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/config.py
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-01-23 09:56:42 +0100
committerRobert Honz <exislow+github@gmail.com>2024-01-23 09:56:42 +0100
commitcdd9965a0f2b97aa276332cf3c621859f6ba68d6 (patch)
tree589c85692efba8e55a118f0a82f275fe7579d577 /tidal_dl_ng/config.py
parenta3473599316779b04a30de4a01bf893a68428219 (diff)
downloadtidal-dl-ng-cdd9965a0f2b97aa276332cf3c621859f6ba68d6.tar.gz
♻️ Minor refactoring of login methods and namings.
Diffstat (limited to 'tidal_dl_ng/config.py')
-rw-r--r--tidal_dl_ng/config.py15
1 files 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)