Skip to content

Fix Spotify playlist extraction 403 (Forbidden)#180

Merged
fiso64 merged 3 commits into
fiso64:masterfrom
yramocan:fix/playlist-items-403
Jun 15, 2026
Merged

Fix Spotify playlist extraction 403 (Forbidden)#180
fiso64 merged 3 commits into
fiso64:masterfrom
yramocan:fix/playlist-items-403

Conversation

@yramocan

@yramocan yramocan commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

This is the actual fix for #160.

The lib bump to SpotifyAPI.Web 7.4.2 back in March added Playlists.GetPlaylistItems() (which hits /playlists/{id}/items), but GetPlaylist() in Spotify.cs was never switched over - it's still calling the old Playlists.GetItems(), which is now just a thin obsolete wrapper around the dead /playlists/{id}/tracks endpoint. So the package bump didn't actually change any behavior, which is why people are still hitting 403 Forbidden on 2.7.0 and current master.

This swaps the call to GetPlaylistItems() and updates the field access from track.Track to track.Item, since the /items response renames that field. Also dropped the page size from 100 to 50, since that's the documented max for /items (the old /tracks endpoint allowed 100).

Tested against the live API - confirmed /tracks 403s even for playlists you own, while /items returns 200 for the same playlist. Built and ran against a few hundred track playlist end to end, extraction and downloads both work now.

yramocan and others added 3 commits June 15, 2026 16:35
GetPlaylist() called the obsolete SpotifyAPI.Web Playlists.GetItems(),
which hits the now-removed /playlists/{id}/tracks endpoint and returns
403 Forbidden for apps in Development Mode (Spotify Feb 2026 API change).

Switch to Playlists.GetPlaylistItems(), which uses the current
/playlists/{id}/items endpoint, and read the items via track.Item
instead of track.Track (the new endpoint renames the "track" field to
"item"). Also cap the page size at 50, the documented max for /items.

Fixes fiso64#160
spotify(TM) premium(TM) is now required for reading playlists.
@fiso64 fiso64 force-pushed the fix/playlist-items-403 branch from df0b507 to 3f0b068 Compare June 15, 2026 15:10
@fiso64

fiso64 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Thanks!

@fiso64 fiso64 merged commit fa3b28a into fiso64:master Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants