mirror of
https://github.com/Googolplexed0/zotify.git
synced 2026-04-25 06:15:55 +03:00
[GH-ISSUE #149] [Bug Report] Metadata KeyError (album_type) #131
Labels
No labels
bug
considering
discussion
documentation
enhancement
enhancement
good first issue
help wanted
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/zotify#131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SnackaJax on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/149
Originally assigned to: @Googolplexed0 on GitHub.
Zotify Version
v0.11.15
Bug Description
When trying to download a specific playlist, an error appears during the Parsing Playlist Info stage.
Bug Triggering Command
zotify https://open.spotify.com/playlist/3mvGR7mx1MXQb8jyX1CXrI --print-skips TRUE --skip-existing TRUE --config-location G:\Users\SnackaJax\AppData\Roaming\Zotify --creds G:\Users\SnackaJax\AppData\Roaming\Zotify --client-id cef47aea04974db3b294cd6a600f35a9
Error Traceback / Logs
zotify_DEBUG_2026-01-12_13-00-40.log
Console output:
DEBUG
config_DEBUG.json saved to G:\Users\SnackaJax\AppData\Roaming\Zotify
zotify_DEBUG_2026-01-12_13-00-40.log logging to I:\Zotify Downloads
DEBUG
Session Initialized Successfully
User Subscription Type: PREMIUM
Request Parsed as 1 URL
DEBUG
Total API Calls: 7
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "c:\users\snackajax.local\bin\zotify.exe_main.py", line 6, in
sys.exit(main())
~~~~^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify_main.py", line 143, in main
client(args, modes)
~~~~~~^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 85, in client
perform_query(args)
~~~~~~~~~~~~~^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 77, in perform_query
raise e
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 48, in perform_query
Query(Zotify.DATETIME_LAUNCH).request(urls).execute()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1725, in execute
self.parse_direct_metadata(*self.fetch_direct_metadata(direct_reqs_objs))
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1540, in parse_direct_metadata
obj.grab_more_children(hide_loader=True)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1161, in grab_more_children
self._main_items.extend(self.parse_linked_objs(item_resps, self._contains))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 267, in parse_linked_objs
obj.parse_metadata(resp) # theoretically shouldn't lose metadata by re-parsing if obj was parsed prev
~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 565, in parse_metadata
self.artists = self.parse_linked_objs(track_resp[ARTISTS], Artist)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 267, in parse_linked_objs
obj.parse_metadata(resp) # theoretically shouldn't lose metadata by re-parsing if obj was parsed prev
~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1282, in parse_metadata
if album_resp[ALBUM_TYPE]: self.type: str = album_resp[ALBUM_TYPE]
~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'album_type'
Config File
config_DEBUG.json
Additional Context
I am on the Efficient-api branch. I have been able to download a big playlist (over 4000 tracks) just fine on this version over the course of a couple of days. It seems like an issue with this playlist. Haven't found other playlist with the same issue yet. I have been able to download this playlist before on earlier versions of the main branch.
@Googolplexed0 commented on GitHub (Jan 20, 2026):
@SnackaJax see if the new-hierarchy branch fixes this issue.
@SnackaJax commented on GitHub (Jan 20, 2026):
@Googolplexed0 Thanks for your work, but the issue does not look fixed unfortunately. I have ran the same command as before.
zotify_DEBUG_2026-01-20_09-41-52.log
config_DEBUG.json
Console Output:
DEBUG
config_DEBUG.json saved to G:\Users\jacco\AppData\Roaming\Zotify
zotify_DEBUG_2026-01-20_09-41-52.log logging to I:\Zotify Downloads
DEBUG
Session Initialized Successfully
User Subscription Type: PREMIUM
Request Parsed as 1 URL
WARNING: Missing Expected Response for Related Metadata Object
Parsing Parent #0 of Track (::Dimitri+K++MBK++ID:143)
Expected Relative Types: ['Album']
#############################################################################################################################################################################
{ 'album_type': None,
'artists': [],
'external_urls': 'URL REMOVED FOR BREVITY',
'href': None,
'id': None,
'images': 'LIST REMOVED FOR BREVITY',
'name': '',
'release_date': None,
'release_date_precision': None,
'type': 'album',
'uri': None}
#############################################################################################################################################################################
DEBUG
Total API Calls: 6
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "c:\users\snackajax.local\bin\zotify.exe_main.py", line 6, in
sys.exit(main())
~~~~^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify_main.py", line 143, in main
client(args, modes)
~~~~~~^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 186, in client
perform_query(args)
~~~~~~~~~~~~~^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 178, in perform_query
raise e
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\app.py", line 149, in perform_query
Query(Zotify.DATETIME_LAUNCH).request(urls).execute()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1506, in execute
self.parse_query_metadata(self.fetch_query_metadata())
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1356, in parse_query_metadata
if obj.needs_expansion: obj.grab_more_children(hide_loader=True)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 1064, in grab_more_children
item_objs = self.parse_relatives(item_resps, self._contains)
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 267, in parse_relatives
new_relative.parse_metadata(self, resp)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 231, in parse_metadata
for k, v in Metadata(self, resp).dict.items():
~~~~~~~~^^^^^^^^^^^^
File "C:\Users\SnackaJax\pipx\venvs\zotify\Lib\site-packages\zotify\api.py", line 151, in init
self.album : Album = obj.parse_relatives([album], Album, make_parent=parent)[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
PS C:\Users\SnackaJax>
After reviewing the error I saw it got stuck on a track that I have manually added to the playlist as an MP3 file from my PC.(Dimitri+K++MBK++ID). After removing this track it got stuck on the next "custom" track in that playlist. Zotify used to ignore these tracks as far as I can see, becuase I don't see the "custom" tracks in the downloaded folder from previous attempts.
Have I just been lucky with it skipping those tracks before, or is zotify supposed to handle these kinds of tracks?
Edit: I also tried selecting the playlist after using the --p argument, and it gave the same error
@Googolplexed0 commented on GitHub (Jan 20, 2026):
It is supposed to handle custom tracks. This should be easily fixable, the new metadata system just needs a few minor tweaks. There are always a few hidden issues with total reworks like this.
@Googolplexed0 commented on GitHub (Jan 21, 2026):
Should be fixed with
github.com/Googolplexed0/zotify@ee88dfca80@SnackaJax commented on GitHub (Jan 21, 2026):
Thanks again for fixing and maintaining this project @Googolplexed0 :)