librespot-org / librespot

Open Source Spotify client library
MIT License
4.7k stars 573 forks source link

Free accounts and non-logging-in sessions #1130

Closed carrieroent closed 1 year ago

carrieroent commented 1 year ago

Hello!

Why exactly we don't or cannot support free accounts and non-logging-in sessions? We use the official Spotify API right?

The Spotify API allows access to information such as tracks metadata without login and API keys (source). With these, we could offer a preview of available of the available tracks to those who are not logged in, as the official client does.

Accessing the content (music) requires API keys and Spotify account with OAuth. If the account in the request is a non-Premium account, the API does not agree to return anything that belongs to non-Premium account (such as stream without ads). If it is Premium account, the API can then grant access. The Spotify API documentation tells about this several times, and nowhere does it mention that Free accounts are blocked; they only have the same things available in the API that have available in the official Spotify app (which uses the same API). So, what is the problem? https://developer.spotify.com/documentation/general/guides/authorization/

In addition, we are a library. The Spotify API requires CLIENT_ID and CLIENT_SECRET for all API calls that require logged in account. So if we bring a feature here, Spotify still has full control. If any program abuses the Spotify API, they can just block their CLIENT_ID (sources 1, 2).

eladyn commented 1 year ago

The problem here is that librespot doesn't use the official Spotify API, but a reverse engineered private API that the official Spotify clients are using. As you can see from the docs of the official API, there's no way to download or decrypt the contents of the audio tracks, since that would make abusing the service pretty easy.

Hope that is the answer you were looking for.

carrieroent commented 1 year ago

Oh, how we (technically) able to access Spotify's internal, private API? And how it isn't against the terms of service?

Why doesn't Spotify allow access to its streaming API? I mean, they make money with Premium's monthly fees and Free's ads. Doesn't it matter to them whether I use their own client or someone else? They can still give access to only what blelongs to me and I still pay them. I would like use my favorite music player, let's say Rhytmbox (example), for all my music listening. There are tracks from local and my server, but also rented music in own section (streaming service, Spotify, Deezer, Tidal, Apple Music or else). I understand that there is no standard for this yet, which forces to make a dedicated plugin for each streaming service, but why would they want to prevent this kind of integration? It's to their advantage!

carrieroent commented 1 year ago

What all does the Spotify API(s) here offer?

carrieroent commented 1 year ago

Do you know any music streaming services that offer a streaming API? It doesn't have to be open, but accessible to also other than the service provider partner companies.

michaelherger commented 1 year ago

IMHO librespot and the web API serve two different purposes: librespot is the player part, whereas the web API allows you to browse and discover the content. You use the latter to figure out what you want to play (instead of eg. the official Spotify app), then tell librespot what you want to play, and librespot would do just that. Therefore the web API doesn't care whether you're a paying customer or not. It only provides metadata about the music, but not the music itself.

carrieroent commented 1 year ago

IMHO librespot and the web API serve two different purposes: librespot is the player part, whereas the web API allows you to browse and discover the content. You use the latter to figure out what you want to play (instead of eg. the official Spotify app), then tell librespot what you want to play, and librespot would do just that. Therefore the web API doesn't care whether you're a paying customer or not. It only provides metadata about the music, but not the music itself.

Okay, the Spotify internal API is "streaming API" and the public Spotify API is for metadata. Does the official client also use the public Spotify API for metadata? Does the public Spotify API also has capable of play snippets of songs and, for example, embed these into websites and apps? And is the "streaming API" only capable of streaming or does it also serve some other tasks, such as user settings?

Were you able to answer my other questions?

roderickvd commented 1 year ago

The official clients use the private API only for everything. Our reverse engineering and use of this private API is legally in the grey area and so far tolerated by Spotify. Keeping it Premium-only makes sure can be fine with that, as Spotify and artists get their share.

roderickvd commented 1 year ago

I am closing this issue as it is clear that we will not support Free accounts. Feel free to continue discussion at https://github.com/librespot-org/librespot/discussions/1131.

carrieroent commented 1 year ago

I am closing this issue as it is clear that we will not support Free accounts. Feel free to continue discussion at #1131.

Remember that this issue also cover non-logged-in sessions.

carrieroent commented 1 year ago

The official clients use the private API only for everything. Our reverse engineering and use of this private API is legally in the grey area and so far tolerated by Spotify. Keeping it Premium-only makes sure can be fine with that, as Spotify and artists get their share.

Okay. Do we use only that the same private API or do we use the private API + public Spotify API?

carrieroent commented 1 year ago

Feel free to continue discussion at https://github.com/librespot-org/librespot/discussions/1131.

That was an invalid question, as we apparently don't use the public Spotify API. I'm opening a new discussion thread for the questions that bother me.

roderickvd commented 1 year ago

Okay. Do we use only that the same private API or do we use the private API + public Spotify API?

Private API only. It has no such thing as non-logged-in sessions.

That was an invalid question, as we apparently don't use the public Spotify API. I'm opening a new discussion thread for the questions that bother me.

This may be just language, but you jump into here asking questions that show no knowledge of this project, and things bother you? Looking at your profile, I see you have created this account yesterday and have already opened 8 other "issues" (more akin to questions) to projects related to Deezer and Qobuz. What do you intend to achieve or contribute?

carrieroent commented 1 year ago

Private API only. It has no such thing as non-logged-in sessions.

How? With the official Spotify desktop client you can browse tracks, but not listen without logging in.

This may be just language, but you jump into here asking questions that show no knowledge of this project, and things bother you? Looking at your profile, I see you have created this account yesterday and have already opened 8 other "issues" (more akin to questions) to projects related to Deezer and Qobuz. What do you intend to achieve or contribute?

Wrong word. I 'ponder' these things. I want know more about how these works. So? Many projects use issues for questions.

carrieroent commented 1 year ago

https://github.com/librespot-org/librespot/discussions/1132

roderickvd commented 1 year ago

Private API only. It has no such thing as non-logged-in sessions.

How? With the official Spotify desktop client you can browse tracks, but not listen without logging in.

Feel free to read the source code or follow the Spotify client network behaviour. This is not the place for a lecture on the inner workings, unless you need something specific to resolve some blocker for a PR.

This may be just language, but you jump into here asking questions that show no knowledge of this project, and things bother you? Looking at your profile, I see you have created this account yesterday and have already opened 8 other "issues" (more akin to questions) to projects related to Deezer and Qobuz. What do you intend to achieve or contribute?

Wrong word. I 'ponder' these things. I want know more about how these works. So? Many projects use issues for questions.

We don't. You may use GitHub discussions or our Gitter chat at https://gitter.im/librespot-org/spotify-connect-resources.

carrieroent commented 1 year ago

Feel free to read the source code or follow the Spotify client network behaviour. This is not the place for a lecture on the inner workings, unless you need something specific to resolve some blocker for a PR.

I think this is the right place to discuss how we could implement this feature.

We don't. You may use GitHub discussions or our Gitter chat at https://gitter.im/librespot-org/spotify-connect-resources.

I know and in this project I put the questions to GitHub discussion and I put only this feature request to here.

You seem a little irritated. I can understand that and I'm sorry if I did something wrong, thanks for your work!