summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/gui.py
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2024-11-29 17:42:31 +0100
committerGitHub <noreply@github.com>2024-11-29 17:42:31 +0100
commit6da679b262dc99cd8798e18845385947491fb86e (patch)
tree9ccb8c4c273ce96fd6ebce8ea2077d281d812712 /tidal_dl_ng/gui.py
parent4deaf94fb53ad304db73f9384f817b29afcac4a8 (diff)
parent33a30537e9a205dd4b43e891b00c0b5f15a9b71b (diff)
downloadtidal-dl-ng-6da679b262dc99cd8798e18845385947491fb86e.tar.gz
Merge pull request #257 from exislow/login-to-simple
Login to simple
Diffstat (limited to 'tidal_dl_ng/gui.py')
-rw-r--r--tidal_dl_ng/gui.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py
index d85c8a0..4d3c38a 100644
--- a/tidal_dl_ng/gui.py
+++ b/tidal_dl_ng/gui.py
@@ -5,6 +5,7 @@ from collections.abc import Callable, Sequence
from PySide6.QtGui import QStandardItem
from requests.exceptions import HTTPError
+from tidalapi.session import LinkLogin
from tidal_dl_ng import __version__, update_available
from tidal_dl_ng.dialog import DialogLogin, DialogPreferences, DialogVersion
@@ -128,16 +129,20 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
result = self.tidal.login_token()
if not result:
- hint: str = "Watiting for user input."
+ hint: str = "After you have finished the TIDAL login via web browser click the 'OK' button."
+
while not result:
- url_login = self.tidal.session.pkce_login_url()
- d_login: DialogLogin = DialogLogin(url_login=url_login, hint=hint, parent=self)
- url_redirect: str = d_login.url_redirect
+ link_login: LinkLogin = self.tidal.session.get_link_login()
+ d_login: DialogLogin = DialogLogin(
+ url_login=link_login.verification_uri_complete,
+ hint=hint,
+ expires_in=link_login.expires_in,
+ parent=self,
+ )
if d_login.return_code == 1:
try:
- token: dict[str, str | int] = self.tidal.session.pkce_get_auth_token(url_redirect)
- self.tidal.session.process_auth_token(token)
+ self.tidal.session.process_link_login(link_login, until_expiry=False)
self.tidal.login_finalize()
result = True