Reputation: 695
There are a lot of videos in the channel. Where as 'nextPageToken' only iterates about 570 of them on my code.
Perhaps not a lib issue because the same happens on https://developers.google.com/youtube/v3/docs/search/list. After about only 10 pages the nextPageToken disappears.
Upvotes: 2
Views: 890
Reputation: 7803
You should using channel+playlistItems API to get ALL channel videos, not search API.
Kindly check it out on https://developers.google.com/youtube/v3/docs/channels/list#try-it.
Example, i set the channel id UCi-Lb1gFer4U7tkqFA1adiQ and part parameter as contentDetails.
the example of response is:
"items": [
{
"id": "UCi-Lb1gFer4U7tkqFA1adiQ",
"kind": "youtube#channel",
"etag": "\"NT-fDeVOLsFPouddIzcaWbd0fJw/sQKRHjGLTreNbWWrW3gIojOKiEk\"",
"contentDetails": {
"relatedPlaylists": {
"uploads": "UUi-Lb1gFer4U7tkqFA1adiQ"
}
}
}
]
Then you know the uploads playlist id now, UUi-Lb1gFer4U7tkqFA1adiQ, so you visit
https://developers.google.com/youtube/v3/docs/playlistItems/list
Put UUi-Lb1gFer4U7tkqFA1adiQ as the playlistId, then you would able to get all the videos by pagination.
p/s: please provide your channel id, if you still experience the problem
Upvotes: 1