diff options
| author | exislow <exislow@users.noreply.github.com> | 2025-10-22 21:38:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 21:38:30 +0200 |
| commit | b485292807a5c7f6c108acc63987bc28cc2c7624 (patch) | |
| tree | 5edae77b6685f4fd3bab085058326a313929fa04 /tidal_dl_ng/config.py | |
| parent | 0cf3516fb054c312c504d45ca5fe60caf34f9a21 (diff) | |
| parent | e9070eef66622ac80c9e7a68b00aa268e669e8fa (diff) | |
| download | tidal-dl-ng-b485292807a5c7f6c108acc63987bc28cc2c7624.tar.gz | |
Merge pull request #596 from Winman486/fix/rate-limiting-playlist-downloads
Fix/rate limiting playlist downloads
Diffstat (limited to 'tidal_dl_ng/config.py')
| -rw-r--r-- | tidal_dl_ng/config.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py index 28ea58b..f41f314 100644 --- a/tidal_dl_ng/config.py +++ b/tidal_dl_ng/config.py @@ -224,6 +224,26 @@ class Tidal(BaseConfig, metaclass=SingletonMeta): return True + def validate_session(self) -> bool: + """Validate that the TIDAL session is still authenticated. + + Returns: + bool: True if session is valid, False otherwise. + """ + return self.session.check_login() + + def is_authentication_error(self, error: Exception) -> bool: + """Check if an error is related to authentication/OAuth issues. + + Args: + error (Exception): The exception to check. + + Returns: + bool: True if the error is authentication-related, False otherwise. + """ + error_msg = str(error) + return "401" in error_msg or "OAuth" in error_msg or "token" in error_msg.lower() + class HandlingApp(metaclass=SingletonMeta): event_abort: Event = Event() |
