zen-audio-player / zen-audio-player.github.io

Listen to YouTube videos, without the distracting visuals.
https://zen-audio-player.github.io/
MIT License
228 stars 180 forks source link

Search Results showing Max of 5 Results via Search #433

Closed maiteemate closed 1 month ago

maiteemate commented 3 months ago

When accessing this URL: 'https://zen-audio-player.github.io/' the web app is limited to show the Max Results of '5' results when searching for any song or video.

Is there a way to increase this via a setting or configuration file? This hugely limits what can be played with the web interface on the URL above.

Please let me know if I'm missing anything. In any event, thank you for a very simple, and useful YT web app.

shakeelmohamed commented 3 months ago

Hi @maiteemate!

The YouTube API defaults to a value of 5 for maxResults, so we’re just consuming their default.

It’s not ideal, but as a workaround you can search on youtube.com then copy/paste a link over.

If you’re interested in making a PR for this feature, I’m happy to guide you through it.

RLalor commented 2 months ago

A PR to increase the results you mean? Do you want to change it or stick with 5? How would you like it? This seems like an easy edit

shakeelmohamed commented 2 months ago

@RLalor I believe youtube.com fetches results in batches of 10, so a quick change is to set maxResults to 10.

A more nuanced solution would be loading multiple batches of results. Here are some possible approaches, ranked most to least preferred (by me):

  1. A “load more” button
  2. Pagination
  3. Infinite scroll like youtube.com

Happy to discuss this further if you’re interested in working on this.

RLalor commented 1 month ago

Thanks for the reply. I cloned it and if I end up playing with it and completing something I will let you know.

shakeelmohamed commented 1 month ago

@maiteemate I’m closing this for now as we can get 10 results per search now. If you want to see a different solution, please reopen and let’s continue the discussion.

Thanks to @RLalor the quick PR #436.