Spotifyd / spotifyd

A spotify daemon
https://spotifyd.rs
GNU General Public License v3.0
9.68k stars 444 forks source link

Being able to download local files from other Devices #1276

Open jWXZSCsqrpZRSVwauBjn opened 3 months ago

jWXZSCsqrpZRSVwauBjn commented 3 months ago

Is your feature request related to a problem? Please describe. Support for syncing local files from other devices as explained in the Spotify Developer docs.

eladyn commented 2 months ago

These docs only explain, how the tracks metadata appears in API requests. AFAIK, there's no possibility to retrieve them from the device that added it.

jWXZSCsqrpZRSVwauBjn commented 2 months ago

it is. You add it to a playlist and make it offline available on another device. If they are in the same network, they sync local songs

eladyn commented 2 months ago

Oh, now it also works for me. (reference) I dug around a bit, but could not find any previous work to reverse engineer that protocol. And while I assume that I figured out, which TCP/UDP messages are related to syncing, I wasn't able to see how they're doing it.

Things I found out:
- When hitting the download button on the phone, it sends a UDP request to everyone on the network (port: 57621) containing `SpotUdp0` and other things. - The desktop app responds with a similar message specifically to the requesting device (port: 57621) at least containing the number `57621` and other things. - Then the real communication begins over TCP, where the files seem to be transmitted. So not a lot I figured out, unfortunately.

So if anyone else is interested in reversing this protocol, this might be interesting, but for now, this is probably out of scope. (Considering that this isn't even implemented on official connect devices.)