[GH-ISSUE #78] [Bug Report] KeyError crash after queueing playlist download #66

Closed
opened 2026-02-27 04:57:20 +03:00 by kerem · 2 comments
Owner

Originally created by @qvattr0 on GitHub (Sep 15, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/78

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version
v0.10.12

Bug Description
I've decided to give the new branch with the upgraded API call system a try so I installed it and tried to download some tracks from a playlist. After running zotify -p and selecting the appropriate ID for the playlist, I received a KeyError message. You can find more information below.

Bug Triggering Command
zotify -p

Error Traceback / Logs

zotify_DEBUG_2025-09-15_12-27-34.log

Traceback (most recent call last):
  File "/Users/firuzq/.local/bin/zotify", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/__main__.py", line 134, in main
    args.func(args, modes)
    ~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 81, in client
    perform_query(args)
    ~~~~~~~~~~~~~^^^^^^
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 71, in perform_query
    raise e
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 53, in perform_query
    UserPlaylists(Zotify.DATETIME_LAUNCH).execute()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1744, in execute
    self.parse_direct_metadata(*self.select_user_playlists(fetched_playlists))
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1484, in parse_direct_metadata
    obj.parse_metadata(item_resp)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1191, in parse_metadata
    tracks_or_eps: list[dict] = [item[TRACK] for item in playlist_resp[TRACKS][ITEMS]]
                                                         ~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'items'

Config File

config_DEBUG.json

Originally created by @qvattr0 on GitHub (Sep 15, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/78 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** v0.10.12 **Bug Description** I've decided to give the new branch with the upgraded API call system a try so I installed it and tried to download some tracks from a playlist. After running `zotify -p` and selecting the appropriate ID for the playlist, I received a KeyError message. You can find more information below. **Bug Triggering Command** `zotify -p` **Error Traceback / Logs** [zotify_DEBUG_2025-09-15_12-27-34.log](https://github.com/user-attachments/files/22329160/zotify_DEBUG_2025-09-15_12-27-34.log) ``` Traceback (most recent call last): File "/Users/firuzq/.local/bin/zotify", line 7, in <module> sys.exit(main()) ~~~~^^ File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/__main__.py", line 134, in main args.func(args, modes) ~~~~~~~~~^^^^^^^^^^^^^ File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 81, in client perform_query(args) ~~~~~~~~~~~~~^^^^^^ File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 71, in perform_query raise e File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 53, in perform_query UserPlaylists(Zotify.DATETIME_LAUNCH).execute() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1744, in execute self.parse_direct_metadata(*self.select_user_playlists(fetched_playlists)) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1484, in parse_direct_metadata obj.parse_metadata(item_resp) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "/Users/firuzq/.local/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1191, in parse_metadata tracks_or_eps: list[dict] = [item[TRACK] for item in playlist_resp[TRACKS][ITEMS]] ~~~~~~~~~~~~~~~~~~~~~^^^^^^^ KeyError: 'items' ``` **Config File** [config_DEBUG.json](https://github.com/user-attachments/files/22329179/config_DEBUG.json)
kerem 2026-02-27 04:57:20 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Googolplexed0 commented on GitHub (Sep 16, 2025):

Fixed this bug/crash and quite a few others that were lurking in UserPlaylists and the other subclasses of Query. Thanks for finding these!

<!-- gh-comment-id:3294724876 --> @Googolplexed0 commented on GitHub (Sep 16, 2025): Fixed this bug/crash and quite a few others that were lurking in UserPlaylists and the other subclasses of Query. Thanks for finding these!
Author
Owner

@qvattr0 commented on GitHub (Sep 16, 2025):

Of course! When do you think the version with the fixes will be available for downloads?

<!-- gh-comment-id:3295063304 --> @qvattr0 commented on GitHub (Sep 16, 2025): Of course! When do you think the version with the fixes will be available for downloads?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zotify#66
No description provided.