spotifydl-core icon indicating copy to clipboard operation
spotifydl-core copied to clipboard

It doesn't work on certain playlists, but works on other (the same API/user)

Open ChrystianSchutz opened this issue 3 years ago • 2 comments

Hi, Thanks for the tool, but I have this playlist that is public and returns following error when using downloadPlaylist(https://open.spotify.com/playlist/0G2k0WxH9Vvt6s7z7YAmjL?si=ddc8473ca3c645c2):

TypeError: Cannot read properties of undefined (reading 'map')
    at SpotifyFetcher.<anonymous> (D:\MuzykTworzenie\spotifyDownload\node_modules\spotifydl-core\dist\lib\API.js:144:89)
    at Object.next (D:\MuzykTworzenie\spotifyDownload\node_modules\spotifydl-core\dist\lib\API.js:14:53)
    at fulfilled (D:\MuzykTworzenie\spotifyDownload\node_modules\spotifydl-core\dist\lib\API.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Other playlists worked fine for example for the same machine/API keys/user: downloadPlaylist(https://open.spotify.com/playlist/6uLG1eyIndx3mwURQIYV7F?si=b4431402a23d4374&nd=1)

ChrystianSchutz avatar Dec 02 '22 12:12 ChrystianSchutz

same error with playlist - https://open.spotify.com/playlist/6erqXmUhndc9DmQBMsImyY?si=tdOMvOQdR6KAZy9916kXcg

Shubhamrawat5 avatar Aug 31 '23 19:08 Shubhamrawat5

Found the issue inside extractPlaylist function

details.tracks = details.tracks.concat(playlistTracksData.items.map((item) => item.track!.id)) should be details.tracks = details.tracks.concat(playlistTracksData.tracks.items.map((item) => item.track!.id))

Shubhamrawat5 avatar Aug 31 '23 19:08 Shubhamrawat5