sigma67 / ytmusicapi

Unofficial API for YouTube Music
https://ytmusicapi.readthedocs.io
MIT License
1.71k stars 194 forks source link

The songs search not limit the results #534

Closed DavidGarzonV closed 8 months ago

DavidGarzonV commented 8 months ago

Describe the bug

When i search songs with a filter query like the code below, and sending the limit, i'm getting always 20 results, instead of 10:

search_song_results = ytmusic.search(
    query=f"{title} {artist}",
    filter="songs",
    scope=None,
    limit=10,
    ignore_spelling=False
)

To Reproduce Steps to reproduce the behavior:

  1. Create the YTMusic object
  2. Call the method search, sendig all the params
  3. Print the len of the resulting list: print(len(results))
  4. See error when the len is 20 instead the limit value

Additional context

sigma67 commented 8 months ago

https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter