Web UI: playlist/album URLs always fail with `Invalid URL` (download handler calls `Song.from_url()`)

Author: xak47dCreated Sep 21, 2026Updated Sep 22, 2026

Describe the bug

In the web UI (spotdl web), clicking download on a playlist (or album) URL always fails immediately with Invalid URL, even though the same URL is accepted by the web UI's own search step and works fine via the CLI.

The UI shows a loading spinner that never resolves, so it looks like a hang rather than an error. The failure is only visible in the server log.

Log output

INFO:     [<client>] Search term: https://open.spotify.com/playlist/<id>
INFO:     [<client>] Valid URL detected, redirecting to downloads...
INFO:     [<client>] Download requested: https://open.spotify.com/playlist/<id>
ERROR:    Error downloading! Invalid URL: https://open.spotify.com/playlist/<id>

Root cause

spotdl/web/routes.py:323 resolves the requested URL with Song.from_url():

python
song = Song.from_url(signals.song_url)

But Song.from_url() (spotdl/types/song.py:77-78) only accepts single-track URLs:

python
if "open.spotify.com" not in url or "track" not in url:
    raise SongError(f"Invalid URL: {url}")

A playlist URL contains open.spotify.com but not track, so this raises unconditionally. Playlist/album/artist URLs can never succeed through this path.

The CLI works because it resolves queries via spotdl/utils/search.py (get_simple_songs / parse_query), which expands playlists, albums and artists into individual songs before download.

Two secondary points:

  1. The search step accepts the URL and logs Valid URL detected, redirecting to downloads..., so the UI advertises support for a URL type the download handler cannot handle.
  2. The spinner button is patched in before the try block, and the exception path doesn't appear to replace it, so the user sees an indefinite loading state with no error surfaced in the browser.

Suggested fix

Have the download handler expand the query the same way the CLI does (e.g. get_simple_songs(...) / parse_query(...)) and download the resulting list, rather than assuming a single track. Failing that, the search step should reject non-track URLs so the UI doesn't accept input it cannot process — and the spinner should be cleared on error.

Steps to reproduce

  1. spotdl web --host 0.0.0.0 --port 8800 --keep-alive --web-use-output-dir
  2. Open the UI and paste any playlist URL, e.g. https://open.spotify.com/playlist/<any-playlist-id>
  3. Search succeeds and the UI redirects to downloads
  4. Click download — spinner appears and never resolves; server log shows Invalid URL
  5. The same URL downloads correctly via spotdl download <url> / spotdl sync <url>

Environment

  • spotdl 4.5.2 (pip, venv)
  • Python 3.11.2
  • yt-dlp 2026.08.19
  • Debian 12 (bookworm), aarch64 / Raspberry Pi 4

Source: spotDL/spotify-downloader