(01-31-2024, 08:47 PM)Tim Curtis Wrote: lol
IIRC from years past there was a project called "raspotify" that was getting metadata and covers. I'm not sure what approach was being used.
As a refresh, how are you currently getting metadata using the track id?
I use curl to do exactly what a browser does: get the open-spotify page; then I filter the html through sed to get only some <meta> tags in the header with the information I need. I do 3 calls in cascade: one for the track, one for the album and the last one for the artist. I get text and IDs (that help for the subsequent "requests").
As I said, I can get everything moOde shows in the NowPlaying view.
Artist name
Album title + cover art URI +
year
Track title + index + duration
(in the album there are also all the tracks, but since we have no automation there is no need in retrieving them... but they come in anyway, I just don't parse them)
I have made maybe 20 requests, and the average completion time on my Pi box is roughly between 2 and 3 seconds after the initial trackID submission.
All done through command piping, no tem files etc.
If you want I can give you the script to try it yourself; you'll have to take the track ID somehow... I opened spotify in my browser, and from a listed track click on the "three dots" => select "share" => select "Copy song link".
Then, from the song link just take the ID, which is the first parameter to the URI, and invoke my script with such ID as its parameter.
ETA
It's not the first parameter, but the LAST path in the URI: e.g.
https://open.spotify.com/track/4LytRM4HN7YQyEBbdRIlLE?si=e4d5a9621ef8485f
with the above I get
Artist: Snarky Puppy
Album : Live at the Royal Albert Hall
Track : 5 - Bad Kids To The Back - Live (8:22)
Cover :
https://i.scdn.co/image/ab67616d0000b273...80e1056a7d