![]() |
Spotify / Librespot - metadata retrieval POC - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: Spotify / Librespot - metadata retrieval POC (/showthread.php?tid=6183) Pages:
1
2
|
Spotify / Librespot - metadata retrieval POC - Nutul - 01-25-2024 Hi all, this thread was made specifically to keep all information and discussions about the topic - achieve metadata / album-art display with spotify-connect through librespot event signaling and http parsing. There are already libraries (mainly for various dialects of JS, such as Angular) but we chose a different approach. Well, we chose what those libraries do at their innards (retrieve a web page and parse it, from within a browser engine), but without all the browser around. curl for the page retrieval and sed for the stream filtering have been the tools. RE: Spotify / Librespot - metadata retrieval POC - cogitech - 01-26-2024 Pulling this over from the other thread. Al, I will still do as you requested below, when I have some time. Maybe today, maybe next week. I want to set up a moOde server on a separate Rpi for testing this stuff. Earlier I was using my main "production" moode server for testing and messed it up a bit when I fat-fingered the php code. I was able to fix it, but I'd rather make those mistakes on a system that nobody in the home relies on. _______________________________ Hi, can you modify the /var/local/www/commandw/spotevent.sh and add the following lines, always, that is, before the very first IF (then we need to change that script, because ATM for any event other than "started" or "stopped" it just exits... adding these lines before the test at least gets us how-and-when it gets called...) echo "`date +%Y-%m-%dT%T.%N` - PLAYER_EVENT = ${PLAYER_EVENT}" >> /var/log/moode_spotevent.log echo "`date +%Y-%m-%dT%T.%N` - OLD_TRACK_ID = ${OLD_TRACK_ID}" >> /var/log/moode_spotevent.log echo "`date +%Y-%m-%dT%T.%N` - TRACK_ID = ${TRACK_ID}" >> /var/log/moode_spotevent.log echo "`date +%Y-%m-%dT%T.%N` - DURATION_MS = ${DURATION_MS}" >> /var/log/moode_spotevent.log echo "`date +%Y-%m-%dT%T.%N` - POSITION_MS = ${POSITION_MS}" >> /var/log/moode_spotevent.log Then, cast some songs in Spotify, and also do the following: 1. play a song, wait for it to finish, and play the next song. After some time you can stop it. 2. play a song, halfway through select another one to play 3. play a playlist, at least two songs (or do as at point 1) This to see how many times the script gets called; hopefully only one time per event (STOP / PLAYING / CHANGED) Cheers, Al. RE: Spotify / Librespot - metadata retrieval POC - Nutul - 01-26-2024 (01-26-2024, 02:43 PM)cogitech Wrote: Pulling this over from the other thread. Al, I will still do as you requested below, when I have some time. Maybe today, maybe next week. I want to set up a moOde server on a separate Rpi for testing this stuff. Earlier I was using my main "production" moode server for testing and messed it up a bit when I fat-fingered the php code. I was able to fix it, but I'd rather make those mistakes on a system that nobody in the home relies on. No worries, set up your working environment from a fresh install. Then you can just swap an SDcard where you will tackle with out madness... I was thinking, that to communicate back to the UI we'll probably need a socket, and for that matter also something like mpd running in the background... and something to control it. For ordinary playback at the moment we have MPD and MPC, we shall have something like SMC (S.potify M.etadata C.ontroller), which has an open socket connection towards the Spotify UI: upon metadata change we'll invoke SMC with the relevant data, and it will pipe the data to the UI. I still have to investigate the whole thing, but I think I can come up with something early next week (if not tonight, I mean...) But the test I asked you to perform is crucial to be able to determine the load of the script invoked by librespot. RE: Spotify / Librespot - metadata retrieval POC - Tim Curtis - 01-26-2024 There are already a couple ways to get beck-end data to the front-end without having to invent new plumbing. There is also a need to be able to reload the data any time the page is refreshed. When I get some time I'll point you to the code RE: Spotify / Librespot - metadata retrieval POC - Nutul - 01-26-2024 (01-26-2024, 05:53 PM)Tim Curtis Wrote: There are already a couple ways to get beck-end data to the front-end without having to invent new plumbing. There is also a need to be able to reload the data any time the page is refreshed. Cool ![]() thanks. RE: Spotify / Librespot - metadata retrieval POC - robinhood - 01-31-2024 I just posted on the other thread also so i figured i'd post here also. https://moodeaudio.org/forum/showthread.php?tid=6164 I was wondering if we should rewire Moode to use librespot-java which has a local API that can control playback as well as read metadata. I think it has websockets for events also. RE: Spotify / Librespot - metadata retrieval POC - Nutul - 01-31-2024 (01-31-2024, 07:27 PM)robinhood Wrote: I just posted on the other thread also so i figured i'd post here also. As you have seen, I replied on the other thread... The main problem IMO is Java. And - as far as I understand - that it should be not headless in order to use the audio sink. RE: Spotify / Librespot - metadata retrieval POC - Tim Curtis - 01-31-2024 Please do not cross-post. It makes things very messy. RE: Spotify / Librespot - metadata retrieval POC - Tim Curtis - 01-31-2024 (01-31-2024, 08:13 PM)Nutul Wrote:(01-31-2024, 07:27 PM)robinhood Wrote: I just posted on the other thread also so i figured i'd post here also. Right, Java is a no-go. RE: Spotify / Librespot - metadata retrieval POC - Nutul - 01-31-2024 (01-31-2024, 08:23 PM)Tim Curtis Wrote: Right, Java is a no-go. I wasn't in a position to put it as plain as this, but somehow had the feeling. |