[GH-ISSUE #151] Error when trying to browse albums (YTMusic.get_library_albums) #115

Closed
opened 2026-02-27 22:08:07 +03:00 by kerem · 4 comments
Owner

Originally created by @slipx06 on GitHub (Jan 14, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/151

Hi. I'm using the yTube Music Player integration for home assistant. When using the api to try browse my Albums I get the error below. I can browse all other items (playlists, history etc). The author of that integration ( @KoljaWindeler ) suggested that I log an issue here. Please see the error message below:

Calling https://ytmusicapi.readthedocs.io/en/latest/reference.html#ytmusicapi.YTMusic.get_library_albums results in the following error

File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py”, line 140, in get_library_albums
get_continuations(results, ‘gridContinuation’, limit - len(albums), request_func,
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 86, in get_continuations
contents = get_continuation_contents(results, parse_func)
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 129, in get_continuation_contents
return parse_func(continuation[term])
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py”, line 138, in
parse_func = lambda contents: parse_albums(contents, False)
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/library.py”, line 58, in parse_albums
album[‘year’] = nav(data, SUBTITLE3)
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 167, in nav
raise err
File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 161, in nav
root = root[k]
IndexError: list index out of range

Thanks

Originally created by @slipx06 on GitHub (Jan 14, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/151 Hi. I'm using the yTube Music Player integration for home assistant. When using the api to try browse my Albums I get the error below. I can browse all other items (playlists, history etc). The author of that integration ( @KoljaWindeler ) suggested that I log an issue here. Please see the error message below: Calling https://ytmusicapi.readthedocs.io/en/latest/reference.html#ytmusicapi.YTMusic.get_library_albums results in the following error ``` File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run result = self.fn(*self.args, **self.kwargs) File “/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py”, line 140, in get_library_albums get_continuations(results, ‘gridContinuation’, limit - len(albums), request_func, File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 86, in get_continuations contents = get_continuation_contents(results, parse_func) File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 129, in get_continuation_contents return parse_func(continuation[term]) File “/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/library.py”, line 138, in parse_func = lambda contents: parse_albums(contents, False) File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/library.py”, line 58, in parse_albums album[‘year’] = nav(data, SUBTITLE3) File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 167, in nav raise err File “/usr/local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py”, line 161, in nav root = root[k] IndexError: list index out of range ``` Thanks
kerem 2026-02-27 22:08:07 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sigma67 commented on GitHub (Jan 14, 2021):

It seems there is an issue with a specific album. Could you check your library to see if there is any album that is missing the year? Could you link it here?

<!-- gh-comment-id:760273927 --> @sigma67 commented on GitHub (Jan 14, 2021): It seems there is an issue with a specific album. Could you check your library to see if there is any album that is missing the year? Could you link it here?
Author
Owner

@KoljaWindeler commented on GitHub (Jan 14, 2021):

FYI, I don't see the error and I don't have albums without year .. I know .. kind of obvious ..

<!-- gh-comment-id:760282295 --> @KoljaWindeler commented on GitHub (Jan 14, 2021): FYI, I don't see the error and I don't have albums without year .. I know .. kind of obvious ..
Author
Owner

@slipx06 commented on GitHub (Jan 14, 2021):

Found an album without a year

https://music.youtube.com/playlist?list=OLAK5uy_kRmBpXs5-Yc7m3r-1zHzASvDhgug_mfg8

and if I remove it from my Library browsing works again.

<!-- gh-comment-id:760301094 --> @slipx06 commented on GitHub (Jan 14, 2021): Found an album without a year https://music.youtube.com/playlist?list=OLAK5uy_kRmBpXs5-Yc7m3r-1zHzASvDhgug_mfg8 and if I remove it from my Library browsing works again.
Author
Owner

@KoljaWindeler commented on GitHub (Jan 14, 2021):

thanks for the quick fix. look forward to the next release

<!-- gh-comment-id:760310631 --> @KoljaWindeler commented on GitHub (Jan 14, 2021): thanks for the quick fix. look forward to the next release
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#115
No description provided.