Closed magnlund closed 5 years ago
I can confirm that this issue exists in v1.8.1.
It looks like Spotify has changed some of the query flags and parameters needed when playing an artistRadio Id.
Specifically, sid=9
has changed to sid=12
and sn=7
changed to sn=5
// This fails with UPnP error 701
device.playSpotifyRadio('5schNIzWdI9gJ1QRK8SBnc','Ben Howard')
// This also fails, which is essentialy the same thing
device.setAVTransportURI({ uri: "x-sonosapi-radio:spotify:artistRadio:5schNIzWdI9gJ1QRK8SBnc?sid=9&flags=8300&sn=7", metadata: "" })
// Both of these work
// Play Ben Howard radio
device.setAVTransportURI({ uri: "x-sonosapi-radio:spotify:artistRadio:5schNIzWdI9gJ1QRK8SBnc?sid=12&flags=8300&sn=5", metadata: "" })
// Play Sarah Sparks radio
device.setAVTransportURI({ uri: "x-sonosapi-radio:spotify:artistRadio:1rNB96O30Md5JMUNgWwg99?sid=12&flags=8300&sn=5", metadata: "" })
We would need to change the following line in helpers.js
// Replace this line
uri: 'x-sonosapi-radio:' + spotifyUri + '?sid=9&flags=8300&sn=7',
// With this line
uri: 'x-sonosapi-radio:' + spotifyUri + '?sid=12&flags=8300&sn=5',
Will open a PR to fix this.
Tried to change in helpers.js according to above solution but still the same issue
Did you try this?
// Play Ben Howard radio
device.setAVTransportURI({ uri: "x-sonosapi-radio:spotify:artistRadio:5schNIzWdI9gJ1QRK8SBnc?sid=12&flags=8300&sn=5", metadata: "" })
Tried that now instead of using the Playradio function and still the same issue
Regards Magnus Lundberg
Magnus Lundberg Phone: +46 730 23 09 36 Email: contact.magnus.lundberg@protonmail.com
Sent with ProtonMail Secure Email.
āāāāāāā Original Message āāāāāāā On Friday 4 January 2019 kl. 21:15, Villarrealized notifications@github.com wrote:
Did you try this?
//
Play Ben Howard radio
device
.
setAVTransportURI
({ uri
:
"
x-sonosapi-radio:spotify:artistRadio:5schNIzWdI9gJ1QRK8SBnc?sid=12&flags=8300&sn=5
"
, metadata
:
"
"
})
ā You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Could it be a difference in the parameters depending on US or EU region?
Regards Magnus Lundberg
Magnus Lundberg Phone: +46 730 23 09 36 Email: contact.magnus.lundberg@protonmail.com
Sent with ProtonMail Secure Email.
āāāāāāā Original Message āāāāāāā On Friday 4 January 2019 kl. 21:22, Magnus Lundberg contact.magnus.lundberg@protonmail.com wrote:
Tried that now instead of using the Playradio function and still the same issue
Regards Magnus Lundberg
Magnus Lundberg Phone: +46 730 23 09 36 Email: contact.magnus.lundberg@protonmail.com
Sent with ProtonMail Secure Email.
āāāāāāā Original Message āāāāāāā On Friday 4 January 2019 kl. 21:15, Villarrealized notifications@github.com wrote:
Did you try this?
//
Play Ben Howard radio
device
.
setAVTransportURI
({ uri
:
"
x-sonosapi-radio:spotify:artistRadio:5schNIzWdI9gJ1QRK8SBnc?sid=12&flags=8300&sn=5
"
, metadata
:
"
"
})
ā You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Might be worth upgrading to 1.8.1. Not sure if that will fix it, but at least help eliminate possible differences.
I suppose it could be. Iām in the US.
@Villarrealized Spotify be like..... hate them for differentiating between regions. Maybe we should tackle this with queries based on region.
Upgraded to 1.8.1 and changed the parameters and also tested with the avTransport function directly. Same issue! I'm located in EU, Sweden
Regards Magnus Lundberg
Magnus Lundberg Phone: +46 730 23 09 36 Email: contact.magnus.lundberg@protonmail.com
Sent with ProtonMail Secure Email.
āāāāāāā Original Message āāāāāāā On Friday 4 January 2019 kl. 21:26, Villarrealized notifications@github.com wrote:
I suppose it could be. Iām in the US.
ā You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Any suggestions on valid parameters for EU?
Regards Magnus Lundberg
Magnus Lundberg Phone: +46 730 23 09 36 Email: contact.magnus.lundberg@protonmail.com
Sent with ProtonMail Secure Email.
āāāāāāā Original Message āāāāāāā On Friday 4 January 2019 kl. 21:37, Stephan van Rooij notifications@github.com wrote:
@Villarrealized Spotify be like..... hate them for differentiating between regions. Maybe we should tackle this with queries based on region.
ā You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
The way I always find the correct commands is by sniffing out the data from the desktop application with Wireshark. (Sniff WiFi or ether net card, set the filter to tcp port 1400, send the command from the desktop app, extract the soap commands for wireshark)
Will try tomorrow, and will setup a page on the docs on how to do this.
Interesting. I changed the spotify region back and forth from US to EU and ran the same commands multiple times and I had no issue.
@magnlund Are you sure that you have an active Spotify Premium account connected to your Sonos?
I'm not sure if Spotify acts differently based on incoming ip, but I also changed my ip to an ip in Amsterdam and had the same working result no matter which region I set it to.
I have verified that my premium account is linked to my Sonos and played around with the parameters in different ways. Issue still remains. What makes it weird is that it USED to work I think it was unitil August last year and then suddenly stopped working. I use the majority of the URIs on Spotify with Node Sonos and all of them work correct except this. Tried to reauthorize the account and verified premium and still same issue. Right now running out of ideas since it seems to be working on your side. Will await next version from you.
When trying to play Spotify Radio using function playSpotifyRadio(artistId, artistName) error UPnP 701 is raised. It used to work before but it does not anylonger. I use the code from the Example and have also verified correct Region settings (EU). All of the other Spotify play functions work fine though. Please advice
Versions (and Environment)
Node version: 8.9.3 node-sonos version: 1.6.0 OS: Linux (RPi)