Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube: Allow fetching more than 50 items #20

Closed
madiele opened this issue Jul 31, 2023 · 2 comments · Fixed by #22
Closed

YouTube: Allow fetching more than 50 items #20

madiele opened this issue Jul 31, 2023 · 2 comments · Fixed by #22
Assignees
Labels
enhancement New feature or request

Comments

@madiele
Copy link

madiele commented Jul 31, 2023

Hi i've got an issue on my repo about raising the item limit from 50 (the limit for a single YouTube API call)

madiele/vod2pod-rss#90

I've given a look at the code and it seems there is already some kinda of logic for it but it was manually disabled with this line response = {'nextPageToken': ''} before the loop for both channels and playlist

I guess maybe to prevent fetching 3000+ videos accidentally on big channels, do you thing is possible to re-implement the feature back-in some way?

If you want I can open a PR myself too, just tell me what is your preferred solution and I'll code something as soon as I have a spare weekend✌️

@amckee amckee added the enhancement New feature or request label Aug 11, 2023
@amckee amckee self-assigned this Aug 11, 2023
@amckee
Copy link
Owner

amckee commented Aug 11, 2023

Admittedly, my understanding of the Youtube code is lacking since it was written by @aquacash5, though after doing some poking around with this I believe that the code pulls the first 50 results, then if those results include a 'nextPageToken' key, it pulls the next page:

https://github.com/amckee/PodTube/blob/7d9128b19e5e8a93caaafb8593b7368e5cc0d50a/youtube.py#L322C17-L322C17

I've created a branch (https://github.com/amckee/PodTube/tree/Issue20) that includes extra logging in this regard, reporting the number of items and pages that a channel request results in:

2023-08-11 18:23:01,271 [INFO] Got 52 videos from 3 pages

@aquacash5
Copy link

You might have some luck with this alternate API https://developers.google.com/youtube/v3/docs/channels/list. I haven't tested it, but it looks like it could be a drop-in replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants