Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] <Login fail Tidal> #233

Closed
cyberianJE opened this issue Nov 20, 2021 · 12 comments
Closed

[BUG] <Login fail Tidal> #233

cyberianJE opened this issue Nov 20, 2021 · 12 comments
Labels
bug Something isn't working stale

Comments

@cyberianJE
Copy link

Describe the bug

Today I tried using rip but could not do it with Tidal using the command url

Command Used

rip url https://tidal.com/browse/track/203134368

Debug Traceback

DEBUG:streamrip:Config loaded
DEBUG:streamrip:Parsed urls: [('tidal', 'track', 'xxxxxxxxxx')]
DEBUG:streamrip:Searching for {'id': 'xxxxxxxxxx'} in database
DEBUG:streamrip:Executing SELECT EXISTS(SELECT 1 FROM downloads WHERE id=?)
DEBUG:streamrip:{'quality': 3, 'download_videos': True, 'user_id': xxxxxxxxxx, 'country_code': 'xE', 'access_token': 'eyJraWQiOiJ2OU1GbFhqWSIsImFsZyI6IkVTMjU2In0.eyJ0eXBlIjoibzJfYWNjZXNzIiwidWlkIjoxODMwODg2ODIsInNjb3BlIjoid19zdWIgcl91c3Igd191c3IiLCJnVmVyIjowLCJzVmVyIjowLCJjaWQiOjMwMDYsImV4cCI6MTYzNzYzMjU0Niwic2lkIjoiOWZhM2MxMjQtYjFlZi00MzkzLWJhNWYtY2JhZmFkM2EyYzA3IiwiaXNzIjoiaHR0cHM6Ly9hdXRoLnRpZGFsLmNvbS92MSJ9.Oaf0kNlpt-EIB41nuVUid2cVQXcBO48bamOpGTlIge6jQylU3Nh3TMQmJtlwbYMZDlt9cDBoXq6WWbOOfwr-Yg', 'refresh_token': 'eyJraWQiOiJoUzFKYTdVMCIsImFsZyI6IkVTNTEyIn0.eyJ0eXBlIjoibzJfcmVmcmVzaCIsInVpZCI6MTgzMDg4NjgyLCJzY29wZSI6Indfc3ViIHJfdXNyIHdfdXNyIiwiY2lkIjozMDA2LCJzVmVyIjowLCJnVmVyIjowLCJpc3MiOiJodHRwczovL2F1dGgudGlkYWwuY29tL3YxIn0.ANhKkC2RhfQ1r8RTj89J1bP0JRyFTDJbz8e_unuSImmrdTq89J-68qYgReauR_Sg3nayHrV5PZo2TQiCzxOzPoJuAFDvloPrmuU9gNnt5XChHXS8o_An26mYSWpOu9TKdqfUP85bLwJuuV-DH3QU_7fqi_C6fhubdhNQ-wq9zEWepsRz', 'token_expiry': 1637632546.2879903}
DEBUG:streamrip:Logging in with access token

  Stack trace:

  12  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:314 in run
       312│
       313│             try:
     → 314│                 exit_code = self._run(io)
       315│             except Exception as e:
       316│                 if not self._catch_exceptions:

  11  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py:604 in _run
       602│             logger.addHandler(fh)
       603│
     → 604│         super()._run(io)
       605│
       606│     def create_io(self, input=None, output=None, error_output=None):

  10  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:409 in _run
       407│                 io.set_input(ArgvInput(argv))
       408│
     → 409│         exit_code = self._run_command(command, io)
       410│         self._running_command = None
       411│

   9  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:416 in _run_command
       414│     def _run_command(self, command: Command, io: IO) -> int:
       415│         if self._event_dispatcher is None:
     → 416│             return command.run(io)
       417│
       418│         # Bind before the console.command event,

   8  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\base_command.py:118 in run
       116│         io.input.validate()
       117│
     → 118│         status_code = self.execute(io)
       119│
       120│         if status_code is None:

   7  AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\command.py:85 in execute
        83│
        84│         try:
     →  85│             return self.handle()
        86│         except KeyboardInterrupt:
        87│             return 1

   6  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\cli.py:84 in handle
        82│
        83│         if urls:
     →  84│             core.handle_urls(";".join(urls))
        85│
        86│         if len(core) > 0:

   5  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\core.py:186 in handle_urls
       184│                 continue
       185│
     → 186│             self.handle_item(source, url_type, item_id)
       187│
       188│     def handle_item(self, source: str, media_type: str, item_id: str):

   4  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\core.py:198 in handle_item
       196│         :type item_id: str
       197│         """
     → 198│         client = self.get_client(source)
       199│
       200│         if media_type not in MEDIA_TYPES:

   3  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\core.py:360 in get_client
       358│         if not client.logged_in:
       359│             try:
     → 360│                 self.login(client)
       361│             except DeezloaderFallback:
       362│                 client = self.clients["deezloader"]

   2  AppData\Local\Programs\Python\Python39\lib\site-packages\rip\core.py:385 in login
       383│         while True:
       384│             try:
     → 385│                 client.login(**creds)
       386│                 break
       387│             except AuthenticationError:

   1  AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\clients.py:751 in login
        749│             else:
        750│                 logger.debug("Logging in with access token")
     →  751│                 self._login_by_access_token(access_token, user_id)
        752│         else:
        753│             logger.debug("Logging in as a new user")

  Exception

  Login failed {'status': 401, 'subStatus': 6001, 'userMessage': 'User does not have a valid session'}

  at AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\clients.py:968 in _login_by_access_token
       964│         resp = self.session.get(
       965│             "https://api.tidal.com/v1/sessions", headers=headers
       966│         ).json()
       967│         if resp.get("status", 200) != 200:
    →  968│             raise Exception(f"Login failed {resp}")
       969│
       970│         if str(resp.get("userId")) != str(user_id):
       971│             raise Exception(f"User id mismatch {resp['userId']} v {user_id}")
       972│

If this was unexpected, please open a Bug Report at https://github.com/nathom/streamrip/issues/new/choose

Config File

[downloads]
# Folder where tracks are downloaded to
folder = "C:\\Users\\usuario 1\\StreamripDownloads"
# Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal' etc.
source_subdirectories = false

Operating System

windows 10

streamrip version

1.7

Screenshots and recordings

No response

Additional context

The last time It was fine was just 5 days ago.

@cyberianJE cyberianJE added the bug Something isn't working label Nov 20, 2021
@Rekulous
Copy link

As of now, TIDAL Login & Ripping is broken due to a new update.

You're gonna have to wait.

@lzgirlcat
Copy link
Contributor

#232

@elvetemedve
Copy link

Hi @89z,

I can offer an account for you:

-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBUQXZTVFl6K0RuMlhwUUt1
aVBjaGtsWDZONG1Ja0FjYlF6Vm1rakNMeHlzCnh1cU93ekNxcmRUL2xNQVpVOXJ5
WTlwWC9yOWw1ZC8yejlhaEVrQnZ3eVEKLS0tIGtTVDZ4QmZ4VlRodElWUGZRY3p6
aTVORVBqUTFZT2c5azdlVUluaFA1bEEK32BRGzh6aYIhwZJfTQW3wjUyRkAmcE9U
I+iJ1GUeR1MZOKzPezd1fuTIeMM9fxxCKQL8tqQ4l7493eQYRP5n5yVuNMzwj+Nc
-----END AGE ENCRYPTED FILE-----

@darkaeden
Copy link

darkaeden commented Nov 22, 2021

@elvetemedve thanks that works, but @uwuLily PR seems to be a good, simple fix. If thats not the case, then I can continue work on this.

Can you please let me know / redirect to the simple fix mentioned?

Tidal-dl released already a new version addressing the issue (maybe partialy, 24bit looks like not downloadable atm).

@Wim1975
Copy link

Wim1975 commented Nov 22, 2021

Hi, With the fix, downloads are working, but I'm no longer seeing 24/44 or 24/48 mqas but mqas that are downsampled to 16/44 where the mqa signal is destroyed so they can no longer unfold and look like 16/44 pcms (hifi). Same issue as tidal-dl.

(Tidal calls this "cd-quality" but clearly these are not redbooks but mangled mqas.
If no longer able to download mqas, I'm ditching Tidal for this same reason)

@elvetemedve
Copy link

what the hell is "mqa"?

LTDR
A new audio format which meant to be superior to existing audio formats in quality, but in practice it's questionable.

MQA is explored in detain in this video:
https://www.youtube.com/watch?v=pRjsu9-Vznc

@cyberianJE
Copy link
Author

cyberianJE commented Nov 26, 2021

Could you let me know what the fix is? I just saw something about constants.py.

@Wim1975
Copy link

Wim1975 commented Nov 26, 2021

Could you let me know what the fox is? I just saw something about constants.py.

https://github.com/nathom/streamrip/pull/232/files

But after this, all mqas are stripped to 16 bits and then down sampled to 44kHz, as a result :

  • 16/44 mqas still play as 16/44 mqa
  • 24/44 mqas (44.1 ,88.2 ,176.4, 352.8) : bits 17-24 are removed. The resulting 16/44 "mqa-cd" still shows "MQA" + a sample rate on the dac. However there's nothing to unfold as the byte containing the hi-res is gone.
  • 24/48 mqas (48, 96, 192) : bits 17-24 are removed + the 16/48 is downsampled to 16/44.
    Here the dac shows "PCM 16/44".

For some reason Tidal/mqa call this "lossless" which is if you look at what happens a lie.

I noticed in Tidal-downloader app there's a workaround by getting the access token while the tidal app is playing a master.
After that the app is downloading the mqas correctly. But I haven't found out how this can be done in streamrip.
ADDITION :
And this only works when playing a 48k derivate master in the Tidal App, so only when playing a 24/48k, 24/96k or 24/192k; it doesn't seem to work when playing a 44k derivate (24/44.1, 88.2, 176.4). Maybe the access token is different ?

@cyberianJE
Copy link
Author

cyberianJE commented Nov 29, 2021

I got a message saying that tidal downloads are back up, although they are now restricted to quality =2.

Problem is I still get an error when I use the command "rip url + tidal address"
How can I get back to downloading from tidal?
Any help?

@Rekulous
Copy link

I got a message saying that tidal downloads are back up, although they are now restricted to quality =2.

Problem is I still get an error when I use the command "rip url + tidal address" How can I get back to downloading from tidal? Any help?

Run pip3 / pip install streamrip --upgrade and you're set!

@cyberianJE
Copy link
Author

cyberianJE commented Dec 3, 2021

I got a message saying that tidal downloads are back up, although they are now restricted to quality =2.
Problem is I still get an error when I use the command "rip url + tidal address" How can I get back to downloading from tidal? Any help?

Run pip3 / pip install streamrip --upgrade and you're set!

Unfortunately, even after running that command I get this error message when I try using the command "rip url + (tidal address)":

Exception

Refresh failed

at AppData\Local\Programs\Python\Python39\lib\site-packages\streamrip\clients.py:947 in _refresh_access_token
943│ (TIDAL_CLIENT_INFO["id"], TIDAL_CLIENT_INFO["secret"]),
944│ )
945│
946│ if resp.get("status", 200) != 200:
→ 947│ raise Exception("Refresh failed")
948│
949│ self.user_id = resp["user"]["userId"]
950│ self.country_code = resp["user"]["countryCode"]
951│ self.access_token = resp["access_token"]

If this was unexpected, please open a Bug Report at https://github.com/nathom/streamrip/issues/new/choose

@stale
Copy link

stale bot commented Feb 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 1, 2022
@stale stale bot closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

6 participants