nullscreen / yt

The reliable YouTube API Ruby client
MIT License
738 stars 159 forks source link

Limit pagination in YT gem #389

Closed rimshaxoho closed 4 years ago

rimshaxoho commented 4 years ago

I am using

videos = Yt::Collections::Videos.new
videos.where(q: 'star war', safe_search: 'none')

but i can't find any variable to limit pagination like my search has 500+ videos and i just want first 100.

videos.where(q: 'star war', safe_search: 'none', max_results: 10)

it will just limit the per page request. Can you please update documentation if there is any way.

kangkyu commented 4 years ago

Hello

videos = Yt::Collections::Videos.new
videos.where(q: 'star war', safe_search: 'none').first(10)

This will only make 1 request. Is that what you need? About documentation, we should work on it. Thank you

rimshaxoho commented 4 years ago

Hello

videos = Yt::Collections::Videos.new
videos.where(q: 'star war', safe_search: 'none').first(10)

This will only make 1 request. Is that what you need? About documentation, we should work on it. Thank you

Yes exactly I was looking for that and found help in closed issues. But I think it will be great if you put this in documentation. Thank You!!!