Skip to content

KeyError: 'genres' #2619

@Vecaneno

Description

@Vecaneno

System OS

Linux

Python Version

Python 3.14.2

Install Source

pip / PyPi

Install version / commit hash

4.4.3

Expected Behavior vs Actual Behavior

Song downloads VS KeyError: 'genres'

Steps to reproduce - Ensure to include actual links!

-1. Set Up SpotDL (With a Premium account and developer app credentials) "client_id": "xxx", "client_secret": "xxx", "auth_token": "xxx", "user_auth": true,
0. Choose any song, really doesn't do anything differently.

  1. spotdl https://open.spotify.com/track/41JnKQ5nyWDsWUQnpyes3U
  2. An error occurred
  3. KeyError: 'genres'

Traceback

╭──────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────╮
│ /home/abc/.local/lib/python3.11/site-packages/spotdl/console/entry_point.py:160 in entry_point                                                                  │
│                                                                                                                                                                    │
│   157 │   try:                                                                                                                                                     │
│   158 │   │   # Pick the operation to perform                                                                                                                      │
│   159 │   │   # based on the name and run it!                                                                                                                      │
│ ❱ 160 │   │   OPERATIONS[arguments.operation](                                                                                                                     │
│   161 │   │   │   query=arguments.query,                                                                                                                           │
│   162 │   │   │   downloader=downloader,                                                                                                                           │
│   163 │   │   )                                                                                                                                                    │
│                                                                                                                                                                    │
│ /home/abc/.local/lib/python3.11/site-packages/spotdl/console/download.py:25 in download                                                                         │
│                                                                                                                                                                    │
│   22 │   """                                                                                                                                                       │
│   23 │                                                                                                                                                             │
│   24 │   # Parse the query                                                                                                                                         │
│ ❱ 25 │   songs = get_simple_songs(                                                                                                                                 │
│   26 │   │   query,                                                                                                                                                │
│   27 │   │   use_ytm_data=downloader.settings["ytm_data"],                                                                                                         │
│   28 │   │   playlist_numbering=downloader.settings["playlist_numbering"],                                                                                         │
│                                                                                                                                                                    │
│ /home/abc/.local/lib/python3.11/site-packages/spotdl/utils/search.py:251 in get_simple_songs                                                                    │
│                                                                                                                                                                    │
│   248 │   │   │   │   │                                                                                                                                            │
│   249 │   │   │   │   │   lists.append(spot_list)                                                                                                                  │
│   250 │   │   elif "open.spotify.com" in request and "track" in request:                                                                                           │
│ ❱ 251 │   │   │   songs.append(Song.from_url(url=request))                                                                                                         │
│   252 │   │   elif "https://spotify.link/" in request:                                                                                                             │
│   253 │   │   │   resp = requests.head(request, allow_redirects=True, timeout=10)                                                                                  │
│   254 │   │   │   full_url = resp.url                                                                                                                              │
│                                                                                                                                                                    │
│ /home/abc/.local/lib/python3.11/site-packages/spotdl/types/song.py:117 in from_url                                                                              │
│                                                                                                                                                                    │
│   114 │   │   │   │   if raw_album_meta["copyrights"]                                                                                                              │
│   115 │   │   │   │   else None                                                                                                                                    │
│   116 │   │   │   ),                                                                                                                                               │
│ ❱ 117 │   │   │   genres=raw_album_meta["genres"] + raw_artist_meta["genres"],                                                                                     │
│   118 │   │   │   disc_number=raw_track_meta["disc_number"],                                                                                                       │
│   119 │   │   │   disc_count=int(raw_album_meta["tracks"]["items"][-1]["disc_number"]),                                                                            │
│   120 │   │   │   duration=int(raw_track_meta["duration_ms"] / 1000),                                                                                              │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Other details

Linux Fedora 43 KDE/Plasma Edition

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugUnexpected problem or unintended behavior that needs to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions