Skip to content

fix(spotify): fallback for public playlist API 404#284

Merged
bambanah merged 4 commits into
bambanah:mainfrom
deecypher:fix/spotify-public-playlist-404-fallback
Mar 26, 2026
Merged

fix(spotify): fallback for public playlist API 404#284
bambanah merged 4 commits into
bambanah:mainfrom
deecypher:fix/spotify-public-playlist-404-fallback

Conversation

@deecypher

Copy link
Copy Markdown

Summary

This fixes Spotify playlist imports that fail with:

Unrecognised response code: 404 - Not Found. Body: {"error":{"status":404,"message":"Resource not found"}}

for some public playlist URLs.

What changed

  • Keep existing Spotify playlist API flow first.
  • If playlist fetch returns 404, fallback to parsing the public playlist page HTML:
    • Read music:song meta tags from https://open.spotify.com/playlist/:id
    • Extract track IDs
    • Resolve tracks with sp.tracks.get(...)
    • Build a spotify_playlist Convertable from resolved tracks
  • Improved Spotify error-status extraction for SDK errors that only expose status in message text.
  • Relaxed Spotify playlist link parsing to accept non-numeric IDs.
  • Added clearer error type for inaccessible Spotify playlist API paths.

Repro / validation

  • Repro URL:
    • https://open.spotify.com/playlist/37i9dQZEVXbp2RxXb8FTfF
  • Before: queue error with raw Spotify SDK 404.
  • After: fallback path resolves the playlist and produces a valid convertable (27 tracks in local test).

Notes

This preserves current behavior for normal playlist API access and only uses HTML fallback when Spotify playlist API returns 404 for otherwise public links.

@deecypher deecypher requested a review from bambanah as a code owner March 6, 2026 02:33
@changeset-bot

changeset-bot Bot commented Mar 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 065bf5e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
deemix Patch
deemix-webui Patch
deemix-gui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@deecypher

Copy link
Copy Markdown
Author

Quick note on checks: I verified this branch locally and deemix-webui builds successfully.

pnpm --filter deemix-webui build

Given that vercel.json has "deploymentEnabled": false, the failing Vercel status appears to be an external integration/deployment context rather than a functional regression from this PR.

@bambanah bambanah merged commit 87b5dad into bambanah:main Mar 26, 2026
1 check 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