mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #370] Implementation of get_search_suggestions endpoint #293
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#293
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @omgupta15 on GitHub (Apr 4, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/370
Is your feature request related to a problem? Please describe.
The
get_search_suggestionsendpoint is not implemented yet.Describe the solution you'd like
I created this endpoint for a project recently and would like to contribute it to the library.
Describe alternatives you've considered
NA
Additional context
The commit for endpoint:
github.com/omgupta15/ytmusicapi@c20728029dUnittest:
github.com/omgupta15/ytmusicapi@ef844f4ad0I've tested the feature and it seems to be working fine.
Here's a demo of its implementation:
https://user-images.githubusercontent.com/36772158/229929357-42f09c66-df18-4535-a90e-3f0f44a65c5b.mov
Should I raise a PR?
@sigma67 commented on GitHub (Apr 4, 2023):
Hello @omgupta15, gladly submit a PR! This has already been requested in #342 and was still missing.
For the PR I have a few things in mind:
mixins/search.pyandparsers/search.pyrespectively - the browsing mixin is already pretty large and unwieldydetailed_runs, as the bolded text is always what the user typed and thus what's known to user of your library function (equal toqueryparam). Feel free to let me know if I missed somethingWith those out of the way it should be good to merge.
@omgupta15 commented on GitHub (Apr 5, 2023):
Hey @sigma67, thanks for the suggestions.
browsingmixin tosearch.detailed_runscan actually be useful in cases when the search term is broken down into parts. For example:When we search for a query like
to moon, we get the following suggestions:to moon, talking to moon, go to moon, to the moon
In the last suggestion,
to&moonare not together and are bolded separately.Detailed runs can help in this case:
'runs': [{'text': 'to', 'bold': True}, {'text': ' the '}, {'text': 'moon', 'bold': True}]I've raised the PR. Here's the link: #372
Let me know if any changes are required.
@sigma67 commented on GitHub (Apr 5, 2023):
Thanks, that explanation is acceptable to me. I'll review the PR
@sigma67 commented on GitHub (Mar 26, 2024):
Hi @omgupta15 , are you actually using
detailed_runsarg? From a typing perspective it's not ideal that it changes the return typeCC @TheOnlyWayUp