- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
None of the below information is required. However, the more you provide the easier it will be for us to try and help.
Plan
Premium
Country
France
Device
(Raspberry Pi)
os
debian
My Question or Issue
I’m trying to use the API in order to call Spotify from a Ruby on Rails application.
For that I’m using the gem rspotify.
Everything works fine except one function was not implemented : queue function.
So I developped it myself.
here is the piece of code I added :
def queue(device_id = nil, uri) url = "me/player/queue?uri=#{uri}" url = device_id.nil? ? url : "#{url}?device_id=#{device_id}" User.oauth_put(@user.id, url, {}) end
Note that this is exactly similar to the play function of rspotify which allows to directly play a song and which works.
here is the full code with other working functions :
https://github.com/guilhermesad/rspotify/blob/master/lib/rspotify/player.rb
When trying to call that, I get the following error:
503 Service Unavailable
here is an example showing the play function working and this one returning the error.
> me = RSpotify::User.new(hash) > player = RSpotify::Player.new(me) > track = RSpotify::Track.search('Know')[0] > > player.play_track(track.uri) => nil > player.queue(track.uri)warning: Overriding "Content-Type" header "application/json" with "application/x-www-form-urlencoded" due to payloadTraceback (most recent call last): 1: from (irb):82 RestClient::ServiceUnavailable (503 Service Unavailable)
Could anyone help me on this?
Solved! Go to Solution.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page