[GH-ISSUE #169] [Bug Report] Local file in playlist causes error #151

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

Originally created by @Mehvix on GitHub (Feb 15, 2026).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/169

Originally assigned to: @Googolplexed0 on GitHub.

Zotify Version
ToT efficient-api, 75641a6

Bug Description
When a playlist has a local file in it, zotify exits with fatal error.

It'd be nice if the local file(s) could be skipped, making bulk exporting easier (my work-around has been to duplicate the playlist then manually prune all local files).

Bug Triggering Command

Passing -p and specifying a playlist that contains a local file.

Error Traceback / Logs

Traceback (most recent call last):
  File "/home/max/.local/bin/zotify", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/__main__.py", line 143, in main
    client(args, modes)
    ~~~~~~^^^^^^^^^^^^^
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 85, in client
    perform_query(args)
    ~~~~~~~~~~~~~^^^^^^
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 77, in perform_query
    raise e
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 58, in perform_query
    UserPlaylist(Zotify.DATETIME_LAUNCH).execute()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1809, in execute
    self.parse_direct_metadata(wrapped_objs, [user_item_resps])
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1538, in parse_direct_metadata
    obj.parse_metadata(item_resp)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1217, in parse_metadata
    largest_image = max(playlist_resp[IMAGES], key=lambda img: img[WIDTH], default={URL: ""})
TypeError: 'NoneType' object is not iterable
Originally created by @Mehvix on GitHub (Feb 15, 2026). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/169 Originally assigned to: @Googolplexed0 on GitHub. **Zotify Version** ToT efficient-api, `75641a6` **Bug Description** When a playlist has a local file in it, zotify exits with fatal error. It'd be nice if the local file(s) could be skipped, making bulk exporting easier (my work-around has been to duplicate the playlist then manually prune all local files). **Bug Triggering Command** Passing `-p` and specifying a playlist that contains a local file. **Error Traceback / Logs** ``` Traceback (most recent call last): File "/home/max/.local/bin/zotify", line 7, in <module> sys.exit(main()) ~~~~^^ File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/__main__.py", line 143, in main client(args, modes) ~~~~~~^^^^^^^^^^^^^ File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 85, in client perform_query(args) ~~~~~~~~~~~~~^^^^^^ File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 77, in perform_query raise e File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/app.py", line 58, in perform_query UserPlaylist(Zotify.DATETIME_LAUNCH).execute() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1809, in execute self.parse_direct_metadata(wrapped_objs, [user_item_resps]) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1538, in parse_direct_metadata obj.parse_metadata(item_resp) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "/home/max/.local/share/pipx/venvs/zotify/lib/python3.13/site-packages/zotify/api.py", line 1217, in parse_metadata largest_image = max(playlist_resp[IMAGES], key=lambda img: img[WIDTH], default={URL: ""}) TypeError: 'NoneType' object is not iterable ```
kerem 2026-02-27 04:57:50 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Googolplexed0 commented on GitHub (Feb 16, 2026):

largest_image = max(playlist_resp[IMAGES], key=lambda img: img[WIDTH], default={URL: ""})
TypeError: 'NoneType' object is not iterable

I think this was fixed in new-hierarchy, change to that branch and see if this error still occurs there.

<!-- gh-comment-id:3905905644 --> @Googolplexed0 commented on GitHub (Feb 16, 2026): > largest_image = max(playlist_resp[IMAGES], key=lambda img: img[WIDTH], default={URL: ""}) > TypeError: 'NoneType' object is not iterable I think this was fixed in [new-hierarchy](https://github.com/Googolplexed0/zotify/tree/new-hierarchy), change to that branch and see if this error still occurs there.
Author
Owner

@Mehvix commented on GitHub (Feb 16, 2026):

Yep, appears to be fixed on new-hierarchy. I see

###   SKIPPING:  " ... " (TRACK IS UNAVAILABLE)   ###

Thank you for the quick reply, and for maintaining this fork. I've used zotify to export 8500 songs and counting

<!-- gh-comment-id:3905977683 --> @Mehvix commented on GitHub (Feb 16, 2026): Yep, appears to be fixed on new-hierarchy. I see ``` ### SKIPPING: " ... " (TRACK IS UNAVAILABLE) ### ``` Thank you for the quick reply, and for maintaining this fork. I've used zotify to export 8500 songs and counting
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#151
No description provided.