问题
I am not getting "nextPageToken" in the response object when I tried to retrieve list of users who subscribed to our channels using YT Data API (v3) Subscription. For some reason YT not returning "nextPageToken" even though below channel has more than 100K subscribers so could you please advise me on how to be able to fetch next pages of subscribers. Same behavior happening when I tried with any of channels from our CMS account:
Request:
https://www.googleapis.com/youtube/v3/subscriptions?onBehalfOfContentOwner=xxxx&onBehalfOfContentOwnerChannel=xxxxxxxxxxx&fields=items(contentDetails,id,snippet(publishedAt,channelId),subscriberSnippet(title,description)),nextPageToken,pageInfo,tokenPagination&maxResults=50&mySubscribers=true&part=id,snippet,contentDetails,subscriberSnippet&key=xxxxxxxxxxxxxxxx&alt=json
Here is sample response snippet ( I trimmed out other 48 items from below list and intentionally masked out subscriber details )
{"items": [{"snippet": {"channelId": "UCUR8UieACc2QXl7waH821hQ", "publishedAt": "2014-05-20T19:50:44.000Z"}, "contentDetails": {"newItemCount": 0, "activityType": "all", "totalItemCount": 51}, "subscriberSnippet": {"description": "", "title": "Sebastian Brentsworth"}, "id": "MVPSEm5kMooIHMvcBKqbtFJAp1dHw0GeHza2Iq5KXP"}, {"snippet": {"channelId": "UCYs04YSyy1soNzyvsDljYVg", "publishedAt": "2014-05-28T22:39:30.000Z"}, "contentDetails": {"newItemCount": 0, "activityType": "all", "totalItemCount": 51}, "subscriberSnippet": {"description": "", "title": "Jason Chan"}, "id": "Xd7_fS3FIA4rnSu6NXEfxF8trXzL8-LspvIuYtDMmc0"}, ], "pageInfo": {"resultsPerPage": 50, "totalResults": 144403}}
回答1:
"Known" (Hopefully also to Google) bug:
https://code.google.com/p/gdata-issues/issues/detail?id=7163 and youtube.subscriptions.list (api v3) - nextPageToken isn't available
For the time being, I've came up with a token generator as a workaround (see other SO post, or here: https://gist.github.com/pulsar256/f5621e85ef50711adc6f)
来源:https://stackoverflow.com/questions/30441952/youtube-data-subscription-api-v3-not-returning-nextpage-when-submitted-with-mysu