[GH-ISSUE #656] "Unable to find 'runs' using path ['title', 'runs', 0, 'text'] on {} #440

Closed
opened 2026-02-27 23:00:48 +03:00 by kerem · 0 comments
Owner

Originally created by @gotofritz on GitHub (Oct 5, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/656

Describe the bug

Under some circumastances, YT returns a playlist where "runs" is under "subtitle" and not "title".

To Reproduce

>>> from ytmusicapi.ytmusic import YTMusic
>>> y = YTMusic(None)
>>> y.get_playlist("PLZ6Ih9wLHQ2Hm2d3Cb0iV48Z2hQjGRyNz", limit=None)

The error I get is

Traceback (most recent call last):
  File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/navigation.py", line 106, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'runs'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/mixins/playlists.py", line 111, in get_playlist
    return self._parse_new_playlist_format(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/mixins/playlists.py", line 201, in _parse_new_playlist_format
    playlist["title"] = nav(header, TITLE_TEXT)
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/navigation.py", line 110, in nav
    raise type(e)(f"Unable to find '{k}' using path {items!r} on {root!r}, exception: {e}")
KeyError: "Unable to find 'runs' using path ['title', 'runs', 0, 'text'] on {}, exception: 'runs'"

Additional context

It could be that YT messed up on their side - for example the playlists where that happens are not listed in my user account but they are there if I access them by direct playlist id. They used to be there, and something is odd. Either way, it does happen, and ytmusicapi should be able to deal with it.

It's an easy fix and I will submit a PR

Originally created by @gotofritz on GitHub (Oct 5, 2024). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/656 **Describe the bug** Under some circumastances, YT returns a playlist where "runs" is under "subtitle" and not "title". **To Reproduce** ``` >>> from ytmusicapi.ytmusic import YTMusic >>> y = YTMusic(None) >>> y.get_playlist("PLZ6Ih9wLHQ2Hm2d3Cb0iV48Z2hQjGRyNz", limit=None) ``` The error I get is ``` Traceback (most recent call last): File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/navigation.py", line 106, in nav root = root[k] ~~~~^^^ KeyError: 'runs' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/mixins/playlists.py", line 111, in get_playlist return self._parse_new_playlist_format( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/mixins/playlists.py", line 201, in _parse_new_playlist_format playlist["title"] = nav(header, TITLE_TEXT) ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/fritz/work/ytm2spt/venv/lib/python3.12/site-packages/ytmusicapi/navigation.py", line 110, in nav raise type(e)(f"Unable to find '{k}' using path {items!r} on {root!r}, exception: {e}") KeyError: "Unable to find 'runs' using path ['title', 'runs', 0, 'text'] on {}, exception: 'runs'" ``` **Additional context** It could be that YT messed up on their side - for example the playlists where that happens are not listed in my user account but they are there if I access them by direct playlist id. They used to be there, and something is odd. Either way, it _does_ happen, and ytmusicapi should be able to deal with it. It's an easy fix and I will submit a PR
kerem closed this issue 2026-02-27 23:00:48 +03:00
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#440
No description provided.