microlinkhq / spotify-url-info

Get metadata from any Spotify URL.
MIT License
72 stars 16 forks source link

SyntaxError: Unexpected token % in JSON at position 9 #55

Closed Muh9049 closed 4 years ago

Muh9049 commented 4 years ago

Randomly started getting this like 30 mins ago. Spotify playlists have always worked.

Muh9049 commented 4 years ago

Thanks, playlists work. But albums aren't working.. Any fix for that?

Muh9049 commented 4 years ago

Individual Spotify song links don't seem to work either.

timozaaijer commented 4 years ago

Same issue here, none of the support "types" actually return data

Muh9049 commented 4 years ago

This issue is so weird too because it was literally working yesterday until this error happened. Did Spotify change up how their playlists and links work? Similar errors also happened to me for YouTube Playlists and SoundCloud playlists for different modules.

timozaaijer commented 4 years ago

I don't use any other modules for YouTube/Soundcloud/other platforms. Just this module to turn Spotify URLs into data which I can throw into YouTube. Used the file mentioned above and it worked fine again

Muh9049 commented 4 years ago

Playlists only seem to work for me now though, not albums or individual Spotify song links, I just get some weird error of "cannot read forEach of undefined". No idea how to fix it since I'm assuming its because of the module.

timozaaijer commented 4 years ago

What line is that error on

Muh9049 commented 4 years ago

image That's what the line is, it says cannot read property forEach of undefined. I assume its because its not getting the album data?

timozaaijer commented 4 years ago

Albums, Artists and Playlists return different Objects, look into those and fix your code. This is an issue on your side ^^

Muh9049 commented 4 years ago

Really? Because albums always worked with that code. Unless it changed what am I supposed to change it to?

karlsander commented 4 years ago

A new version that fixes this issue is available on npm (npm install spotify-url-info@2.1.0).Thanks @crxts.

This library relies on scraping unofficial spotify data which they can change at any time without notice. So it is to be expected that it can stop working without any code errors in your app or the library. All we can do is adapt the library to spotify changes as quickly as possible.

karlsander commented 4 years ago

If you have a specific spotify link that still doesn't work with the new version, please share it.

karlsander commented 4 years ago

BTW if at all possible you should try to use the data from getPreview, not getData, though that doesn't give you the entire playlist of course.

The getData data is passed on directly from spotify, so they may change it without triggering the tests for this library to fail.

There is a new type of podcast spotify embed page now that I just added parsing for. I expect other media types may move to the new style as well. The data between those two page styles is also not neccessarily the same, but getPreview always is.