01-24-2024, 02:36 AM
(01-24-2024, 12:44 AM)cogitech Wrote:(01-24-2024, 12:25 AM)Nutul Wrote: Cool, but how did you get that json object from?
It's the example from the Github page, here: https://github.com/microlinkhq/spotify-url-info
I would try it myself, but I am not sure what the author means by the following:
In order to use the library, you have to provide the fetch agent to use:
const fetch = require('isomorphic-unfetch')
const { getData, getPreview, getTracks, getDetails } =
require('spotify-url-info')(fetch)
As I said, I am not a coder. I can write simple shell scripts and do other basic linux sysadmin/server tasks, but not actual coding.
I would guess that by "fetch agent" he means something like wget, but that's just a guess.
So, as I said, once you install all that stuff (and it is all for front-end as I can see) and the engine has done its work parsing the open-spotify page, you are presented with that object, from which you can take the album art and artist/track info (no sign of the album, BTW)
I tried to do the same, and TTYTT I was able to locate Artist, track title and album art - no trace of the album.
Can be retrieved by a further parsing of another spotify ID (the album Id, which is in the previous data...)
There is only a small problem: in order to get all that information we need the Spotify track ID, which only your phone and spotify-connect know...