TimeForANinja / node-ytsr

Do anonymous YouTube search requests.
MIT License
285 stars 66 forks source link

Missing nextpageRef in results for branch wip-api-adjustments #87

Closed flaviotordini closed 3 years ago

flaviotordini commented 3 years ago

nextpageRef is never present in the data returned by ytsr so pagination is impossible.

TimeForANinja commented 3 years ago

the pagination responses don't include the basic meta information therefor pagination is currently only implemented internally linked to the limit option

flaviotordini commented 3 years ago

Btw, I found that setting the limit above 20 always causes an error: The "listener" argument must be of type Function. Received type object

TimeForANinja commented 3 years ago

May i ask which version & branch you run and as well as your node.js version?

patrickkfkan commented 3 years ago

Hello,

Are there any plans to include nextPageTokens in the results so we can continue a previous search? Thanks.

-Patrick

TimeForANinja commented 3 years ago

it should be fast to add a continuation property would work a bit different from the nextPageToken thou...

patrickkfkan commented 3 years ago

I see you've made some changes to support continuation in the wip branch (also for ytpl). That was quick~ Thanks a lot!

So if we need to continue a previous search, we would use 'pages' instead of 'limit', and each 'page' will have 100 results. Is that correct?

TimeForANinja commented 3 years ago

as mentioned - was quick to add ytpl should return 100 results ytsr should return 22 results i can't enforce this thou, so it might vary

i wanted to add pages for a while now, since it is a way more efficient way (talking request count and therefor ratelimits)

disabled continuation for limit since continuation works in whole pages - so doing sth like ytpl(id, {limit: 25}) followed by a continuation call would result in one page being fetched, item 26-100 spliced since it's over the limit and item 101-200 being fetched by the continuation