Thank you for your donation!


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


Thread Closed 
Problem: Newbie questions: web interface login, Spotify and radio stations
#17
(01-24-2024, 09:33 PM)Nutul Wrote:
(01-24-2024, 09:02 PM)cogitech Wrote: [2024-01-24T20:44:48Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"TRACK_ID": "0RffFIV29Yb7vjGokb0e6q", "PLAYER_EVENT": "playing", "POSITION_MS": "0", "DURATION_MS": "256875"}

[2024-01-24T20:45:07Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"OLD_TRACK_ID": "0RffFIV29Yb7vjGokb0e6q", "TRACK_ID": "14f6jZAEm43fqsrrZpYVeT", "PLAYER_EVENT": "changed"}

[2024-01-24T20:45:11Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"DURATION_MS": "267360", "PLAYER_EVENT": "playing", "TRACK_ID": "14f6jZAEm43fqsrrZpYVeT", "POSITION_MS": "0"}

These messages cought my attention... I have no knowledge about librespot, but I see that a script is being called when the track changes, so that in that script we could add my commands to retrieve the relevant information.

Then what remains to do is find a way to pass the relevant metadata to moOde, IDK, by invoking some php... existing or to-be-created... maybe @Tim Curtis can share a word here.

Happy to see it works... as far as Spotify does not change the header of the pages it will continue to work for centuries to come...
Maybe there is a way to download only the html head with curl, and this will possibly speed up the thing a little bit.

Nice catch! It is even passing the "TRACK_ID" variable to the script.

Interestingly, spotevent.sh does not reference that variable at all. Perhaps Tim had some plans for this in the future?

I agree, it really looks like your script code could be integrated into spotevent.sh. Something like:

if [[ $PLAYER_EVENT == "playing" ]]; then run Al's code with "$TRACK_ID" and dump the metadata [/to/some/file]

Then the overlay php can grab what it needs from [/to/some/file].


Messages In This Thread
RE: Newbie questions: web interface login, Spotify and radio stations - by cogitech - 01-24-2024, 10:09 PM

Forum Jump: