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

HI_RES_LOSSLESS stream is available even when using Oauth authentication #277

Open
tehkillerbee opened this issue Sep 9, 2024 · 9 comments

Comments

@tehkillerbee
Copy link
Collaborator

It appears that Oauth authentication is enough for getting access to HI_RES_LOSSLESS audio. Perhaps this occurred after the recent tidal subscription changes.

If this is indeed the case, documentation should be updated accordingly, as PKCE login does not appear to be necessary anymore to get full HI_RES_LOSSLESS quality.

@GioF71
Copy link
Contributor

GioF71 commented Sep 11, 2024

Hello, I just tried HI_RES_LOSSLESS and HI_RES over an existing oauth2 authentication token, but it does not work for me. The media_url apparently is not avaialable. Only "LOSSLESS" (and possibly mp3 I suppose) works with oauth2. Maybe the library needs to reflect the changes you have discovered?
Apparently, I cannot get new pkce token anymore as I get an error when I try to enter my username, but my existing pkce token is currently working in HI_RES_LOSSLESS more.
Fortunately I have two instances of upmpdcli running the tidal plugin in oauth2 and pkce respectively, but of course if would be great if we can have oauth2 working in HI_RES_LOSSLESS mode as you are saying.
Thank you for the great work!

@tehkillerbee
Copy link
Collaborator Author

tehkillerbee commented Sep 11, 2024

@GioF71 Have you tried re-authentication with Oauth?

I am definitely using Oauth right now (I just reauthenticated) and I am presented with a HI_RES_LOSSLESS file. I have only tested it with python-tidal directly. Saving the .MPD file and playing it with ffplay gives me a 192000 Hz, stereo, s32 (24 bit), file

You can try verifying this with the example/pkce_example.py and reauthenticating with do_pkce=False

EDIT: Sorry, you need to use the stream() not the direct URL for this to work.

@GioF71
Copy link
Contributor

GioF71 commented Sep 11, 2024

Hello, I will definitely try. Does this work in the current release 0.7.6 or in the current master branch?

@tehkillerbee
Copy link
Collaborator Author

I've been using the current master branch but I do not see why it shouldn't work for 0.7.6

@GioF71
Copy link
Contributor

GioF71 commented Sep 11, 2024

I've been using the current master branch but I do not see why it shouldn't work for 0.7.6

perfect! will try asap, thank you

@GioF71
Copy link
Contributor

GioF71 commented Sep 11, 2024

Hello, it worked perfectly. It has been the occasion for removing old code that was loading the tokens from env variables. It was a mess and had become completely useless.
May I ask you, as you seem to be about to publish a release, if the method "login_session_file" can also accept an optional print function? That might help me to allow upmpdcli to almost automatically create a credential file. But without that additional argument, the output of the method would never be routed to the upmpdcli log.
Or, of course, if there is an alternative, I might change the code according to your advice.
Thank you once again for the great work!

@tehkillerbee tehkillerbee changed the title HI_RES_LOSSLESS mode is available even when using Oauth authentication HI_RES_LOSSLESS stream is available even when using Oauth authentication Sep 12, 2024
@tehkillerbee
Copy link
Collaborator Author

if the method "login_session_file" can also accept an optional print function?

I've added a separate issue for this. Feel free to add details describing the feature request. PRs are of course always welcome, otherwise I will try to see if I get time to add the feature to v0.7.7 :)

@tedinati
Copy link

I used the example code which is examples/simple.py, And when i try to get hi_res_loseless i get
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url issue

@tehkillerbee
Copy link
Collaborator Author

I used the example code which is examples/simple.py, And when i try to get hi_res_loseless i get requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url issue

You need to use the stream() not the direct URL for this to work with hi_res_lossless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants