toastify icon indicating copy to clipboard operation
toastify copied to clipboard

[PSA] TOASTIFY IS PARTIALLY OUT OF SERVICE

Open aleab opened this issue 6 years ago • 31 comments

CURRENT STATE OF TOASTIFY

As of v1.10.11 Toastify can fetch and show the current song's artist and title using a temporary workaround. The album art won't update and the song progress bar has been disabled altogether for the time being. Hotkeys are still working fine and you'll still be able to control Spotify's playback with them.


THE ISSUE

The unofficial local API served by the Spotify client on a local server needs an OAuth token to be used. The token is retrieved from https://open.spotify.com/token. Currently, Spotify only returns unusable fake tokens, so the local API can't be used anymore to get status updates.

Additionally, since Spotify's version 1.0.87.*, the client doesn't create the local server anymore. This latest change makes Toastify fail to start (whereas before version 1.0.87 it started but the toast wouldn't work), because it obviously can't connect to the non-existing local server (before version 1.0.87, it managed to connect successfully, but failed the authentication whenever it tried to get a status update).

POSSIBLE SOLUTION

The only viable possible solution is to use the official Web API instead, in particular the player or player/currently-playing endpoints to get status updates.

The problem with this solution is that Toastify would need to make a lot of web requests to the same endpoint in a very limited time period to be able to update the toast in an enjoyably short (from a UX point of view) amount of time. As a comparison SpotifyAPI-NET makes 20 status update requests per second by default (Toastify reduced that to 2 requests per second).


(Additional details can be found in issue #82)

aleab avatar Aug 08 '18 23:08 aleab

I was just investigating why it won't connect "connected = this.localAPI.Connect();". Thanks for that update, have a nice day!

I love Toastify :)

DiAbLoxx83 avatar Aug 09 '18 08:08 DiAbLoxx83

Same problem. Download the previous Spotify Versions: https://spotify.en.uptodown.com/windows/old

ItzQuiet avatar Aug 09 '18 13:08 ItzQuiet

Download the previous Spotify Versions:

Do anyone knows what's the latest Spotify working version for Toastify?

WolfganP avatar Aug 09 '18 13:08 WolfganP

The version 1.0.85.259 works fine.

DiAbLoxx83 avatar Aug 09 '18 13:08 DiAbLoxx83

@ItzQuiet I'm sorry, but that would change very little. You'll still be able to control Spotify's playback (which is wonderful!), but the toast (the core of Toastify) won't work.

aleab avatar Aug 09 '18 14:08 aleab

@aleab to make it clear for me and the others, is there a specific Spotify version and Toastify version which still work together? I don`t mind downgrading my Spotify for now.

juliusdeblaaij avatar Aug 09 '18 19:08 juliusdeblaaij

@juliusdeblaaij None if you want toast notifications. If you only want to control Spotify's playback (i.e. you only need the global hotkeys), then every version of Spotify up to 1.0.86.* should work (the current version 1.0.87.* might also work, but I need to make some changes to the code before that happens).

aleab avatar Aug 09 '18 19:08 aleab

After you download an old version of Spotify how do you prevent Spotify from updating itself to the new version? I just really want to use Toastify for the hotkeys for now :(

ifailsnoopy avatar Aug 10 '18 03:08 ifailsnoopy

Hi folks! I've made some changes to let Toastify start correctly with the latest version of Spotify (1.0.87.*). This doesn't fix the big issue, but you'll be able to use Toastify's hotkeys without unnecessarily downgrading Spotify.

Download the new release v1.10.9 here!

aleab avatar Aug 10 '18 10:08 aleab

Cheers for keeping this alive just for the global hotkeys, that's the large part of what I use it for anyway.

IdleMuse avatar Aug 10 '18 13:08 IdleMuse

Ditto to what IdelMuse just said. The hotkeys are 95% of its value to me, so I appreciate you taking the time to release a version for just that.

JediBecker avatar Aug 10 '18 13:08 JediBecker

Thank you thank you so much for keeping this alive!

ifailsnoopy avatar Aug 10 '18 16:08 ifailsnoopy

Thanks for the fix! I mostly use the toast with the "show toast" hotkey to check what (Spotify-suggested) song I'm listening to. Perhaps that could be supported well using the web API without too many calls? (Since the calls would only be done after pressing the hotkey)

pko-github avatar Aug 13 '18 09:08 pko-github

As a temporary workaround, maybe something as simple as displaying the Spotify window title in the toast would suffice? When a song is playing, Spotify's title window is set to "Artist - Track". I know it's rudimentary, but it's better than nothing. Thoughts?

bartuszekj avatar Aug 14 '18 20:08 bartuszekj

That would work for me.

pko-github avatar Aug 15 '18 07:08 pko-github

I would like to see that solution implemented if possible it's better then nothing. Why song toasts isn't a native feature is beyond me.

lazyb5 avatar Aug 23 '18 00:08 lazyb5

Alright, I'll implement the solution proposed by @bartuszekj and possibly release a new version by the end of next week.

aleab avatar Aug 25 '18 22:08 aleab

Thanks for taking my suggestion under consideration, @aleab! Eagerly awaiting the next release now!

bartuszekj avatar Aug 25 '18 22:08 bartuszekj

While I like the idea of a local workaround, it's not quite as robust or future-proof as consuming the API. I'm thinking about adding Web API functionality, at least for my own use. Even if it is a tad delayed (say 5 seconds), that is totally acceptable to me personally. I'm wondering just how bad it is. Does anyone know what rate limits the api applies and how many requests are we talking for a single toast?

TehCupcakes avatar Aug 29 '18 19:08 TehCupcakes

@TehCupcakes, the local workaround would only be temporary. I'm not sure about the rate limits applied by Spotify and there's no definitive number mentioned in the documentation (rate limiting).

As for the number of requests, I'm not sure about that either. We could easily get away with making a single request to /player or /player/currently-playing every time the Toast is shown (and not more than X times every Y seconds, for example) to update the current song info, album art, playing state, etc.; other features and options would instead require more requests.

At the moment I can think of two features that would require, in my opinion, at least a couple of requests per second to have a nice experience:

  • Showing the toast every time the song changes
  • Showing the song progress bar on the toast

Given that the rate limiting is applied per application and not per-user, I'm not sure how feasible that would be.

One more concern I have in using the Web APIs is the risk (more like certainty) of leaking the application keys (client id and secret), since I don't think I'll be able to use a backend for the authentication/authorization flow.

aleab avatar Aug 29 '18 20:08 aleab

The problem with the API is that the app will need to make a heap of web requests to detect when a song has changed.

Instead, perhaps it would be easier and more effective to only call the API when the title of the Spotify app changes, or a hot key is used.

philhawthorne avatar Aug 29 '18 21:08 philhawthorne

it would be easier and more effective to only call the API when the title of the Spotify app changes

I like this!

aleab avatar Aug 29 '18 21:08 aleab

Version 1.10.11 of Toastify is out!

aleab avatar Aug 31 '18 16:08 aleab

Thanks @aleab ! Does it work with the latest Spotify version or some specific old one is required?

WolfganP avatar Aug 31 '18 16:08 WolfganP

@WolfganP It works fine with the latest version.

aleab avatar Aug 31 '18 17:08 aleab

Working great with windows store version. Thanks for implementing the workaround!

lazyb5 avatar Aug 31 '18 22:08 lazyb5

Hello! Just discovered Toastify and love it, even in its (apparently stunted) state. Any progress on this? Shame that the Spotify's API support was thrown in the trash like it was.

Was looking for some ideas to try and help out with pull requests but it does seem like the issues are mainly on Spotify's end :(

Only thing I can think of is that at least on my computer it only shows the Toastify logo instead of any album art? Is that related to the API issue? If it isn't, would it maybe be possible to find a third party source to pull that art from?

quinnr avatar Dec 02 '18 09:12 quinnr

@quinnr I've already worked on implementing Spotify's Web API to be able to get album arts and more accurate info about a song's title/artist(s). I still have to fix a bunch of other stuff and be sure that everything works as expected, though. It may take a while since I don't have much time to work on Toastify right now.

If you are interested in helping out, the current master branch in this repository is up to date and doesn't have any pending commits. You can start from that, if you want. The Web APIs are already being used and album arts should be fetched correctly.

aleab avatar Dec 03 '18 16:12 aleab

If the Album art is 'sort of working', would it be possible to build a beta release or something? Cheers!

IdleMuse avatar Feb 14 '19 12:02 IdleMuse

@IdleMuse of course it's possible. Unfortunately, I don't have any time at all to work on Toastify anymore, but I can release all I've worked on as is.

aleab avatar Feb 14 '19 14:02 aleab