[GH-ISSUE #420] KeyError exception when searching community_playlists or featured_playlists with scope = library #314

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

Originally created by @nick42d on GitHub (Jul 31, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/420

Originally assigned to: @nick42d on GitHub.

G'day,

Noticed that the function parsers.search._get_param_2 does not handle "community_playlists" or "featured_playlists".
However, parsers.search.get_search_params calls this function with these parameters when scope is set to "library" and therefore we get a KeyError.

Happy to raise a PR if you are able to advise if this should be handled with a documented exception or alternative params sent to innertube.

Cheers Nick

To Reproduce
call YTMusic.search('xxx', 'community_playlists', 'library').
result "KeyError: 'community_playlists'"

Originally created by @nick42d on GitHub (Jul 31, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/420 Originally assigned to: @nick42d on GitHub. G'day, Noticed that the function parsers.search._get_param_2 does not handle "community_playlists" or "featured_playlists". However, parsers.search.get_search_params calls this function with these parameters when scope is set to "library" and therefore we get a KeyError. Happy to raise a PR if you are able to advise if this should be handled with a documented exception or alternative params sent to innertube. Cheers Nick **To Reproduce** call YTMusic.search('xxx', 'community_playlists', 'library'). result "KeyError: 'community_playlists'"
kerem 2026-02-27 23:00:08 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sigma67 commented on GitHub (Aug 1, 2023):

I see that appropriate tests are missing as well. https://github.com/sigma67/ytmusicapi/blob/master/tests/test.py#L129

Feel free to fix and add tests :)

<!-- gh-comment-id:1659944750 --> @sigma67 commented on GitHub (Aug 1, 2023): I see that appropriate tests are missing as well. https://github.com/sigma67/ytmusicapi/blob/master/tests/test.py#L129 Feel free to fix and add tests :)
Author
Owner

@nick42d commented on GitHub (Aug 4, 2023):

Have added a PR, please let me know if you see any issues!

<!-- gh-comment-id:1665849192 --> @nick42d commented on GitHub (Aug 4, 2023): Have added a PR, please let me know if you see any issues!
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#314
No description provided.