Love your script/API for Spotify! Been using it a lot.
I have noticed something though.
The API throws 404 errors when you do
Spoofy.Player.LastTrack(),
Spoofy.Player.PlayPause()
and Spoofy.Player.NextTrack()
if you use them before Spotify have played something.
---------------------------
SpotifyShortcuts.ahk
---------------------------
Error in #include file "[PATH]\Spotify.ahk":
404 not 2xx for request "PUT:https://api.spotify.com/v1/me/player/pause".
Line#
173: For index,SubHeaderArray in HeaderArray
173: {
174: SpotifyWinHttp.SetRequestHeader(SubHeaderArray[1], SubHeaderArray[2])
175: }
177: SpotifyWinHttp.Send(body)
179: if (SpotifyWinHttp.Status > 299 && !noErr)
179: {
---> 180: Throw,{message: SpotifyWinHttp.Status . " not 2xx for request """ . method . ":" . url . """.", what: "HTTP response code not 2xx", file: A_LineFile, line: A_LineNumber}
181: }
183: Return,SpotifyWinHttp.ResponseText
184: }
188: {
189: res.SetBodyText("Page not found")
190: }
191: {
The current thread will exit.
---------------------------
OK
---------------------------