Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Spotify Metadata
#11
(10-23-2024, 08:05 PM)Nutul Wrote:
(10-23-2024, 05:06 PM)humboldtsquid Wrote: (...) I wonder how one might go about going around the API and without having to directly rely on an account, a key and all that.

You can "curl" or "wget" the html page of Spotify for the track you want; and parse it: there are IDs in metadata tags that can be used to collect artist, album and album-art with subsequent loads.
I had a POC few (many...?) months ago. It may be slow, of course, compared to the Spotify API.

Oh this is a good idea. I'm wondering though how I might get the track name if my friend Bob decides to connect to my speaker as well and I don't have the name or link to the song he's playing. Ideally anyone could connect to the speaker and not have to use an API or agree to any terms and just have the track they're playing through Spotify Connect show up. This may be something I try out regardless.
Reply
#12
If you connect to moOde is one thing; if you connect to a speaker via BT is a completely different story...
Moode invokes a script when a track changes on Spotify (and maybe also when you play/pause it) and passes in the track's ID, which is all you need to retrieve its information: it is a parameter of the spotify URL IIRC.
Reply
#13
(10-24-2024, 08:09 PM)Nutul Wrote: If you connect to moOde is one thing; if you connect to a speaker via BT is a completely different story...
Moode invokes a script when a track changes on Spotify (and maybe also when you play/pause it) and passes in the track's ID, which is all you need to retrieve its information: it is a parameter of the spotify URL IIRC.

Ah I see, I'll look more in to that approach then that might be perfect. Yeah I imagine Bluetooth would need a separate tool to detect the audio playing and use an external database or something to assign its identity.
Reply
#14
(10-23-2024, 05:06 PM)humboldtsquid Wrote: Hey I just wanted to +1 this idea. I love the implementation you made! I'm currently building a project where I want to have the song title at the very least from the Spotify Connect instance. I noticed in a GitHub issue a dev posted https://github.com/librespot-org/librespot/issues/592 as a reference point. I know the Spotify API is easier but I too am sort of on the boat of using a daemon to just expose the metadata and pulling from there. I'm fairly new to this sort of thing but I wonder how one might go about going around the API and without having to directly rely on an account, a key and all that.

Oh, so the first time I came across that issue I failed to read it properly and librespot does have all the metadata needed. I agree this is a much cleaner, easier and more flexible approach than spotify's web api. Just need to figure out how to best get the data to frontend and write a daemon using librespot that exposes it (or use one of the ones already solving this problem in a usable way).
Reply


Forum Jump: