Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError exception when searching community_playlists or featured_playlists with scope = library #420

Closed
nick42d opened this issue Jul 31, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nick42d
Copy link
Contributor

nick42d commented Jul 31, 2023

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'"

@sigma67
Copy link
Owner

sigma67 commented 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 :)

@sigma67 sigma67 added the bug Something isn't working label Aug 1, 2023
nick42d added a commit to nick42d/ytmusicapi that referenced this issue Aug 4, 2023
… or featured_playlists with scope library
@nick42d nick42d closed this as completed Aug 4, 2023
@nick42d
Copy link
Contributor Author

nick42d commented Aug 4, 2023

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

@nick42d nick42d reopened this Aug 4, 2023
@sigma67 sigma67 closed this as completed in 3bf7b49 Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants