Skip to content

Possible fix for the new api changes, broken metadata and playlist issues #2609

@nyekuuu

Description

@nyekuuu

Pull request with fixes: #2610

I posted a slight fix in the spotdl discord help thread https://discord.com/invite/xCa23pwJWY
https://discord.com/channels/771628785447337985/1472459432293040291

Its a bit complicated but here is the updated source code and files I changed, along with what I typed on discord.
Sorry it's a lot of text :P

some of it is vibecoded because I pulled an all nighter by accident and didn't want to spend ages on this.

spotify.py
song.py
playlist.py
metadata.py

spotdl_patched_feb2026.zip

Discord msg:

spotify changed lots in the api so i fixed the rate limit by specifying credentials in the config and using --config in the download command

for the genre error i skipped it by changing a few lines in the song.py file

so find where spotdl is installed for me im on macos so it was inside

/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spotdl/types/

edit song.py

find

popularity=raw_track_meta["popularity"],
change it to
popularity=raw_track_meta.get("popularity"),

publisher=raw_album_meta["label"],
change it to
publisher=raw_album_meta.get("label"),

genres=raw_album_meta["genres"] + raw_artist_meta["genres"],
change it to
genres=(raw_album_meta.get("genres") or []) + (raw_artist_meta.get("genres") or []),

next i got the yt-dlp error so i edited the config to include youtube as a provider and set my spotify api credentials

i then ran the download command with
--config and downloading started to work

here is the edited song.py file song.py
i dont know if itll actually get the genre, label or popularity and it does break metadata but it gets rid of the other errors and allows the download to at least start

okay ive fixed metadata breaking
go back one folder into the utils folder and replace metadata with this fixed version metadata.py

metadata should work now

Image

so to simplify files are below

find
/python3.10/site-packages/spotdl/types/
replace song.py song.py

find
/python3.10/site-packages/spotdl/utils/
replace metadata.py metadata.py

edit your spotdl confg to include spotify api details

add youtube as an aditional provider in case yt music fails

run your spotdl command with --config to force it to use your config

hope this helps <33
also here is what is in my config file

{
    "client_id": "enter yours",
    "client_secret": "enter yours",
    "auth_token": null,
    "user_auth": false,
    "headless": false,
    "cache_path": "/Users/yourName/.spotdl/.spotipy",
    "no_cache": false,
    "max_retries": 3,
    "use_cache_file": false,
    "audio_providers": [
        "youtube-music", "youtube"
    ],
    "lyrics_providers": [
        "genius",
        "azlyrics",
        "musixmatch"
    ],
    "genius_token": "yourGeniusToken",
    "playlist_numbering": true,
    "playlist_retain_track_cover": false,
    "scan_for_songs": false,
    "m3u": null,
    "output": "{artists} - {title}.{output-ext}",
    "overwrite": "skip",
    "search_query": null,
    "ffmpeg": "ffmpeg",
    "bitrate": "128k",
    "ffmpeg_args": null,
    "format": "mp3",
    "save_file": null,
    "filter_results": true,
    "album_type": null,
    "threads": 4,
    "cookie_file": null,
    "restrict": null,
    "print_errors": false,
    "sponsor_block": false,
    "preload": false,
    "archive": null,
    "load_config": true,
    "log_level": "INFO",
    "simple_tui": false,
    "fetch_albums": false,
    "id3_separator": "/",
    "ytm_data": false,
    "add_unavailable": false,
    "generate_lrc": false,
    "force_update_metadata": false,
    "only_verified_results": false,
    "sync_without_deleting": false,
    "max_filename_length": null,
    "yt_dlp_args": null,
    "detect_formats": null,
    "save_errors": null,
    "ignore_albums": null,
    "proxy": null,
    "skip_explicit": false,
    "log_format": null,
    "redownload": false,
    "skip_album_art": false,
    "create_skip_file": false,
    "respect_skip_file": false,
    "sync_remove_lrc": false,
    "web_use_output_dir": false,
    "port": 8800,
    "host": "localhost",
    "keep_alive": false,
    "enable_tls": false,
    "key_file": null,
    "cert_file": null,
    "ca_file": null,
    "allowed_origins": null,
    "keep_sessions": false,
    "force_update_gui": false,
    "web_gui_repo": null,
    "web_gui_location": null
}

you can auto generate one with
spotdl --generate-config

update for issue downloading playlists

after checking spotify api changelogs the endpoint for getting songs in playlists has changed
in the utils folder
replace spotify.py with this version that has the endpoints updated spotify.py

in the types folder
replace playlists.py with this updated file too playlist.py

go to your spotify application on the developer page
redirect urls should look like this

Image

run
spotdl --config --user-auth download YourPlaylistUrl \ --output "/YourPath/{list-name}/{list-position} - {artist} - {title}.{output-ext}" \ --playlist-retain-track-cover
a tab should open to authenticate
and now playlist downloading should work
the caveat is that you can only download your own playlists and not other peoples due to the api changes sadly

files should work now

Image

i do occasionaly get the yt-dlp error and some songs are missing so it got 28/36
ill test with a cookies file and see if it gets better

Here is updated source code with a changelog so you can all see whats changed etc

spotdl_patched_feb2026.zip

Originally posted by @nyekuuu in #2604

I recommend purging cache too or running the command with --no-cache

Test it out and see if it works, hope it helps in some way

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions