[GH-ISSUE #175] exception occurs if a playlist with no titles exists in library when calling get_library_playlists #133

Closed
opened 2026-02-27 22:08:13 +03:00 by kerem · 1 comment
Owner

Originally created by @oetken on GitHub (Mar 17, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/175

Description

If there is any playlist in your library that contains zero tracks the following exception is thrown:

>>> search_results = ytmusic.get_library_playlists(limit=99)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/mixins/library.py", line 32, in get_library_playlists
    playlists = parse_content_list(results['items'][1:], parse_playlist)
  File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/browsing.py", line 157, in parse_content_list
    contents.append(parse_func(result['musicTwoRowItemRenderer']))
  File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/browsing.py", line 194, in parse_playlist
    'title': nav(data, TITLE_TEXT),
  File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/utils.py", line 210, in nav
    raise err
  File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/utils.py", line 204, in nav
    root = root[k]
Originally created by @oetken on GitHub (Mar 17, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/175 # Description If there is any playlist in your library that contains zero tracks the following exception is thrown: ``` >>> search_results = ytmusic.get_library_playlists(limit=99) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/mixins/library.py", line 32, in get_library_playlists playlists = parse_content_list(results['items'][1:], parse_playlist) File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/browsing.py", line 157, in parse_content_list contents.append(parse_func(result['musicTwoRowItemRenderer'])) File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/browsing.py", line 194, in parse_playlist 'title': nav(data, TITLE_TEXT), File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/utils.py", line 210, in nav raise err File "/home/z001131e/.local/lib/python3.9/site-packages/ytmusicapi/parsers/utils.py", line 204, in nav root = root[k] ```
kerem closed this issue 2026-02-27 22:08:13 +03:00
Author
Owner

@sigma67 commented on GitHub (Mar 17, 2021):

Can you screenshot the playlist in question that's causing the error? The error you posted does not seem related to the count of tracks

Edit: Also works fine for me if I add an empty playlist to my library

<!-- gh-comment-id:801146156 --> @sigma67 commented on GitHub (Mar 17, 2021): Can you screenshot the playlist in question that's causing the error? The error you posted does not seem related to the count of tracks Edit: Also works fine for me if I add an empty playlist to my library
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/ytmusicapi#133
No description provided.