Thank you for your donation!


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


What's playing Spotify Connect on display?
#1
Just discovered this lovely #FOSS audiophile musicstreamer. I got it running on a #raspberrypi 4 with #Hifiberry dac.

One disappointment: Spotify Connect does not show any text or cover, but just "Spotify Active". Any thoughts on changing this?

[Image: f882fba47f35d412.png]
Reply
#2
Many years ago there was some code in moOde that attempted to display metadata/art from Airplay but it was unreliable, possibly due to the way it was written, but in any case it was abandoned and replaced by the "Renderer Active" overlays which are used for all the audio renderers including Bluetooth, Airplay, Spotify Connect, Squeezelite and Roonbridge. The plain background can be enhanced by setting the Prefs option"Renderer backdrop" to yes.

If another dev wants to take on the challenge of capturing/displaying metadata/art then I'll be happy to test.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(07-30-2023, 11:38 AM)Tim Curtis Wrote: Many years ago there was some code in moOde that attempted to display metadata/art from Airplay but it was unreliable, possibly due to the way it was written, but in any case it was abandoned and replaced by the "Renderer Active" overlays which are used for all the audio renderers including Bluetooth, Airplay, Spotify Connect, Squeezelite and Roonbridge. The plain background can be enhanced by setting the Prefs option"Renderer backdrop" to yes.

If another dev wants to take on the challenge of capturing/displaying metadata/art then I'll be happy to test.

Hello Tim,

I had a look on it  (i'am using mainly spotify with moode so i'am really interested). I've noticed that the receiver librespot on event such as started/stopped/changed pass the event itself but also the spotify_id of the song. 

I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Could be intersting to search in that direction. I know it is pretty limited for the moment but i've just had a look yesterday evening. I have now to look on how your system works to push data to the backend/frontend.


The only requirement is to have enable the spotify developper and create an app to have client_id & client_secret (more or less 5min to create it)

Regards,
JM
Reply
#4
(02-23-2024, 04:20 PM)jmguillaume Wrote: I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Hi,
that's exactly what I was able to achieve a month ago, more or less. Though not with the python library, but just using curl (to parse open.spotify webpages) and sed to filter the output.

I didn't proceed to sending the output to the backend / frontend to be shown, but in reality that was the only thing that was left to do.

Depending on how big / heavy is the python thing (and how it is aimed at compatibility towards the soptify "API" could be a better choice...
Reply
#5
(02-23-2024, 04:35 PM)Nutul Wrote:
(02-23-2024, 04:20 PM)jmguillaume Wrote: I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Hi,
that's exactly what I was able to achieve a month ago, more or less. Though not with the python library, but just using curl (to parse open.spotify webpages) and sed to filter the output.

I didn't proceed to sending the output to the backend / frontend to be shown, but in reality that was the only thing that was left to do.

Depending on how big / heavy is the python thing (and how it is aimed at compatibility towards the soptify "API" could be a better choice...

I think the approach that queries spotify web pages takes several seconds to get the metadata but it could be redistributed with moOde.

The approach that uses a Spotify dev account gets the metadata directly and is pretty much instant but the dev account token prolly can't be redistributed due the dev license, correct?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
(02-23-2024, 04:49 PM)Tim Curtis Wrote:
(02-23-2024, 04:35 PM)Nutul Wrote:
(02-23-2024, 04:20 PM)jmguillaume Wrote: I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Hi,
that's exactly what I was able to achieve a month ago, more or less. Though not with the python library, but just using curl (to parse open.spotify webpages) and sed to filter the output.

I didn't proceed to sending the output to the backend / frontend to be shown, but in reality that was the only thing that was left to do.

Depending on how big / heavy is the python thing (and how it is aimed at compatibility towards the soptify "API" could be a better choice...

I think the approach that queries spotify web pages takes several seconds to get the metadata but it could be redistributed with moOde.

The approach that uses a Spotify dev account gets the metadata directly and is pretty much instant but the dev account token prolly can't be redistributed due the dev license, correct?

What are you saying, that the python library does in fact login and get a token for API requests, with dev "privileges"...?
Reply
#7
(02-23-2024, 04:49 PM)Tim Curtis Wrote:
(02-23-2024, 04:35 PM)Nutul Wrote:
(02-23-2024, 04:20 PM)jmguillaume Wrote: I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Hi,
that's exactly what I was able to achieve a month ago, more or less. Though not with the python library, but just using curl (to parse open.spotify webpages) and sed to filter the output.

I didn't proceed to sending the output to the backend / frontend to be shown, but in reality that was the only thing that was left to do.

Depending on how big / heavy is the python thing (and how it is aimed at compatibility towards the soptify "API" could be a better choice...

I think the approach that queries spotify web pages takes several seconds to get the metadata but it could be redistributed with moOde.

The approach that uses a Spotify dev account gets the metadata directly and is pretty much instant but the dev account token prolly can't be redistributed due the dev license, correct?

The request takes 2-3sec at worse as it only request info for a single track.
The dev account on spotify is available only for premium user which is also what is requested in moode, so no big issue.
Now if you want to create to use a generic account that would serve every distribution if i'm not wrong (need to check) as long as you don't make money out of it, it is ok.
Reply
#8
(02-23-2024, 04:35 PM)Nutul Wrote:
(02-23-2024, 04:20 PM)jmguillaume Wrote: I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Hi,
that's exactly what I was able to achieve a month ago, more or less. Though not with the python library, but just using curl (to parse open.spotify webpages) and sed to filter the output.

I didn't proceed to sending the output to the backend / frontend to be shown, but in reality that was the only thing that was left to do.

Depending on how big / heavy is the python thing (and how it is aimed at compatibility towards the soptify "API" could be a better choice...

The script to retrieve the data is 12 lines :-) Spotipy is doing all the job.
Reply
#9
(02-23-2024, 06:05 PM)Nutul Wrote:
(02-23-2024, 04:49 PM)Tim Curtis Wrote:
(02-23-2024, 04:35 PM)Nutul Wrote:
(02-23-2024, 04:20 PM)jmguillaume Wrote: I've tweaked the spotevent.sh script to react to the changed event and not only to started/stopped, installed the python lib Spotipy on my moode player (quick and small) and wrote a small python script called by the spotevent.sh script and pass the spotify_id to it.
Now on every changed event, i have that kind of output (spotify_id, artist, album, song, url to coverart):
7GqIDx2QVGOpd4r1fZaUUW

Chicago
Chicago II
25 or 6 to 4 - 2002 Remaster
https://i.scdn.co/image/ab67616d0000b273...baed5aebf9

Hi,
that's exactly what I was able to achieve a month ago, more or less. Though not with the python library, but just using curl (to parse open.spotify webpages) and sed to filter the output.

I didn't proceed to sending the output to the backend / frontend to be shown, but in reality that was the only thing that was left to do.

Depending on how big / heavy is the python thing (and how it is aimed at compatibility towards the soptify "API" could be a better choice...

I think the approach that queries spotify web pages takes several seconds to get the metadata but it could be redistributed with moOde.

The approach that uses a Spotify dev account gets the metadata directly and is pretty much instant but the dev account token prolly can't be redistributed due the dev license, correct?

What are you saying, that the python library does in fact login and get a token for API requests, with dev "privileges"...?

Hi, Al.

Quoting from the Spotipy docs


Quote:All methods require user authorization. You will need to register your app at My Dashboard to get the credentials necessary to make authorized calls (a client id and client secret).
 
"My Dashboard" links to https://developer.spotify.com/dashboard


Regards,
Kent
Reply
#10
Here are the licenses
https://developer.spotify.com/terms
https://developer.spotify.com/policy
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: