thlucas1 / homeassistantcomponent_spotifyplus

Home Assistant integration for Spotify Player control, services, and soundtouchplus integration support.
MIT License
57 stars 4 forks source link

Spotify closed a bunch of API's #63

Open MolsonB opened 1 day ago

MolsonB commented 1 day ago

System Health details

n/a

Checklist

Describe the issue

Spotify closed a bunch of API's.

https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api

Mainly Get Featured Playlists & Get Category's Playlists. Breaks a few ways to browse the media. Any idea how else to pull the Daily Mix's ?

Reproduction steps

n/a

Debug logs

n/a

Diagnostics dump

No response

thlucas1 commented 1 day ago

@MolsonB Just found out about this myself yesterday, while I was travelling. I must confess this is extremely frustrating, since I just rolled out the track recommendations and the category selection functionality (literally!) less than a week ago!

I have no plans as of now to try an re-implement the affected functionality, as the deprecated Spotify Web API functions were the only way to retrieve the information. It's proprietary data, and if they don't want to share then that's on them.

Sorry, probably not what you (nor I) want to hear, but it's the reality of the situation.

thlucas1 commented 1 day ago

@MolsonB Regarding the Daily Mixes ... they are just playlists, with an assigned playlist id. I believe the playlist id's remain the same, even though the content automatically changes (not sure of change frequency).

To find out the playlist id (and it's uri value), do the following: 1) open Spotify Web Site in a new desktop browser window. 2) click on the desired "Daily Mix ?" entry to display it's details; this will display the playlist id in the url (playlist id is circled in red in the following example): image 3) formulate the Spotify uri value for the playlist; in the example above, the uri would be spotify:playlist:37i9dQZF1E39DIjrju3A9t.

Use the Spotify playlist uri value in the call to SpotifyPlus player_media_play_context service:

service: spotifyplus.player_media_play_context
data:
  entity_id: media_player.spotifyplus_john_s
  context_uri: spotify:playlist:37i9dQZF1E39DIjrju3A9t

I also added this to the FAQ wiki doc.

MolsonB commented 1 day ago

Reading the dev forms, so many people are very upset with Spotify pulling these API's without any warning. All those hours wasted developing apps. One person posted a chat with customer service, and said

"What I meant is that in the next few days, a replacement is coming, and there's an exciting innovation that customers like you will enjoy. I understand this is happening a bit early without prior updates."

For now, I hardcoded the URI values and grabbed the cover image (get_playlist_cover_image) for my lovelace buttons to play specific playlists. Just can't get the description, which I can live without. (For your example, "Petra, Whiteheart, Guardian")