Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Sasha Hilton
@sashahilton00
@devgianlu you won’t see a handshake. websockets is a protocol upgrade, so you’ll see an http request to the websocket endpoint, an upgrade request, followed by a 101 Switching Protocol header, then the websocket messages
Gianlu
@devgianlu

@devgianlu you won’t see a handshake. websockets is a protocol upgrade, so you’ll see an http request to the websocket endpoint, an upgrade request, followed by a 101 Switching Protocol header, then the websocket messages

I don't see any request to dealer.spotify.com at all

Sasha Hilton
@sashahilton00
you retried?
Gianlu
@devgianlu

you retried?

Since I am trying to solve librespot-org/librespot-java#140

macOS-2019-10-12-19-55-03.png
Sasha Hilton
@sashahilton00
theres no traffic to dealer.spotify.com from the desktop client as far as i can see
Gianlu
@devgianlu
If you look at the Wireshark dump, you can see a DNS request for dealer.spotify.com and if you follow the IP all the data is there
Sasha Hilton
@sashahilton00
if i visit dealer.spotify.com i get a google 404 wtf
Gianlu
@devgianlu
You can ping it
BTW, I need to decrypt the dealer traffic because there's an outgoing packet exactly when the client receives any request and that might well be the ack.
Sasha Hilton
@sashahilton00
i can connect to it quite happily, but for some reason i’m not receiving events
ok, fixed it
so here’s how it works:
Gianlu
@devgianlu
I know how it works, I've implemented it already. I just need to know what that message is
Sasha Hilton
@sashahilton00
  1. open a connection using the url and an access token: wss://gew-dealer.spotify.com/?access_token=[ACCESS_TOKEN]in the response headers, there will be a header Sec-WebSocket-Accept with a string in it. store that somewhere. Close the connection.
  2. Reopen the connection to wss://gew-dealer.spotify.com/?access_token=[ACCESS_TOKEN], this time passing the headers Sec-WebSocket-Version: 13, Sec-WebSocket-Extensions: permessage-deflate and Sec-WebSocket-Key: [the value you got from the previous request.
  3. You should then start receiving messages from the endpoint when various actions are carried out. The client appears to send the message {“type”:”ping”} to the server at 30 second intervals, continually. my guess is that this is required to stop the server disconnecting you after a timeout period.
oh right, didnt realise you had it implemented
the {“type”:”ping”} is a standard websocket message used pretty much everywhere to keep a connection alive.
Gianlu
@devgianlu
Yep, I tried to send {"type": "ack"}, but the server closed connection.
Sasha Hilton
@sashahilton00
if you want to investigate it yourself, i used charles and play.spotify.com. once certificate pinning is disabled it’s trivial to see what is going on. also, lose the space in the json, the server didnt seem to like it.
Gianlu
@devgianlu
Oh right, crappy parsing
Thanks, will try your setup. I will also try to see if the browser client has the same API.
Sasha Hilton
@sashahilton00
browser client seems to use it in place of spirc for current state. it looks much cleaner.
also a lot of it looks the same as the public connect api
Gianlu
@devgianlu
Yeah, they tend to use the public API for the browser client
Gianlu
@devgianlu
Can't see the dealer handshake in Charles. Were you able to? @sashahilton00
Sasha Hilton
@sashahilton00
Yes
Gianlu
@devgianlu
That's a bit annoying.
Sasha Hilton
@sashahilton00
What handshake are you looking for? As I said, it’s an https request to get the web sockets key, followed by another https request with the upgrade header and key to open the connection
Gianlu
@devgianlu
I cannot intercept the first (and only) request to dealer.spotify.com probably because Spotify refuses to use the proxy
Cristian Moro
@crsmoro
i dont know if that's helpful at all, but my windows client updated to 1.1.17 and the command (tested with next, prev) are not sent 3 times to librespot-java anymore
Sasha Hilton
@sashahilton00
@devgianlu are you using the pinning disable patch?
If it doesn’t work I’ll just stick the results I got in a doc and fire it over to you so you can implement it
Gianlu
@devgianlu

@devgianlu are you using the pinning disable patch?

Yep

i dont know if that's helpful at all, but my windows client updated to 1.1.17 and the command (tested with next, prev) are not sent 3 times to librespot-java anymore

That would be handy, will test this afternoon

If it doesn’t work I’ll just stick the results I got in a doc and fire it over to you so you can implement it

If you're able to intercept the websocket message, I'd really appreciate it. If so, I'll write you some notes in private.

Gianlu
@devgianlu
librespot-org/librespot-java#140 has been fixed by Spotify themselves since version 1.1.17. Hopefully it won't come back in the next version. Thanks @crsmoro for reporting that.
Gianlu
@devgianlu
Started happening again.
Cristian Moro
@crsmoro
it seems neither they agree with this resend approach
Gianlu
@devgianlu
Will need to investigate further
Do they have a changelog?
Cristian Moro
@crsmoro
i never saw a changelog, but it seems they released 1.1.7 with bugs (so they disabled the ack on server), now the ack is back i can't stop/pause anymore it just keeps playing forever
and i'm not using librespot, just local plyaback on thier client
Gianlu
@devgianlu
Oh so their client is broken?
Cristian Moro
@crsmoro
it appears to be, im on my lunch break, but i can show you in ~1h when i get back to the office
Cristian Moro
@crsmoro
sorry, almost forgot https://streamable.com/46lzy
you can skip, but you cant pause, once you open it's already playing
Gianlu
@devgianlu
I'm expecting a new release in the near future then, but the ack logic seems to be here even in this release. The problem is always the same
tonabnehmer
@tonabnehmer
hello, i have troubles while cross compiling. When compiling for 'arm-unknown-linux-gnueabihf' I receive, 'Cross compilation detected. Use PKG_CONFIG_ALLOW_CROSS=1 to override' and when trying explicitly with the raspberry compile script I get, 'dpkg-deb: error: 'libasound2_1.0.25-4_armhf.deb' is not a debian format archive' am I doing something wrong?
tonabnehmer
@tonabnehmer
When using Dockerfile.Rpi I receive the error: # Executing 1 build trigger...
Step 1/1 : RUN cat /.resin/deprecation-warning
---> Running in 3631e94a7c1b
standard_init_linux.go:178: exec user process caused "exec format error"
The command '/bin/sh -c cat /.resin/deprecation-warning' returned a non-zero code: 1