mherger wrote: 
> I'd still suggest you use curl and the Spotify web API directly. You can
> get the token from spotty:
> 
> > 
Code:
--------------------
  >   > path/to/spotty -n spotty -c path/to/LMS/cache/spotty/someID --get-token
--------------------
> > 
> 
> "someID" is a 8 character string inside the spotty folder. As for
> cache and binary paths, see Settings/Information. This will return
> some JSON data, of which you'd have to extract the accessToken value.
> 
> If you're serious about scripting this, I'd suggest you install the
> "jq" tool to extract information for json. You could then extract the
> token using:
> 
> > 
Code:
--------------------
  >   > path/to/spotty -n spotty -c path/to/LMS/cache/spotty/someID --get-token 
|  jq '.accessToken'
--------------------
> > 


Thanks ! It works perfectly !   :)


My commands line :


Code:
--------------------
    user_id=$(sudo 
/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64
 -n spotty -c /var/lib/squeezeboxserver/cache/spotty/xxxxxxxx --get-token |  jq 
-r '.accessToken')
  
  curl -X "PUT" "https://api.spotify.com/v1/me/player"; --data 
"{"device_ids":["xxx-ID-of-the-target-device-xxx"]}" -H "Accept: 
application/json" -H "Content-Type: application/json" -HH "Authorization: 
Bearer $user_id"
--------------------


To find your xxx-ID-of-the-target-device-xxx you can use this :
https://beta.developer.spotify.com/console/get-users-available-devices/

Is it possible to use spotty command lines for other things ? For
example is it possible to transfert current playlist without using curl
and spotify api ?


By the way two problems that I have often :
    
- I have seeking problems : when I transfer playback the song start at
  begining. Seeking from LMS web interface ,ipeng or directly on
  squeezebox touch is OK but when I use spotify app to seek or the api
  with 'seek '
  (https://beta.developer.spotify.com/console/put-seek/?position_ms=&device_id=)
  it always return to the beginning
- Sometimes, I don't know why the volume is set to minimum just after
  transfer or during playing.


------------------------------------------------------------------------
schmurtz's Profile: http://forums.slimdevices.com/member.php?userid=57368
View this thread: http://forums.slimdevices.com/showthread.php?t=108898

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to