使用mySubscribers

时间:2015-05-25 15:54:00

标签: youtube-data-api

我没有得到" nextPageToken"当我尝试使用YT Data API(v3)订阅检索订阅我们频道的用户列表时,在响应对象中。出于某种原因,YT没有返回" nextPageToken"即使下面的频道有超过10万的订阅者,所以你能告诉我如何能够获取下一页订阅者。当我尝试使用CMS帐户中的任何渠道时,会发生相同的行为:

请求:

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

以下是示例回复片段(我从下面的列表中删除了其他48个项目并故意屏蔽了订阅者详细信息)

{" items":[{" snippet":{" channelId":" UCUR8UieACc2QXl7waH821hQ"," publishedAt&#34 ;:" 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},&#34 ; subscriberSnippet":{" description":""," title":" Jason Chan"}," id& #34;:" Xd7_fS3FIA4rnSu6NXEfxF8trXzL8-LspvIuYtDMmc0"},]," pageInfo":{" resultsPerPage":50," totalResults":144403} }

1 个答案:

答案 0 :(得分:0)

"已知" (希望也是谷歌)bug:

https://code.google.com/p/gdata-issues/issues/detail?id=7163youtube.subscriptions.list (api v3) - nextPageToken isn't available

目前,我已经想出了一个令牌生成器作为解决方法(参见其他SO帖子,或者这里:https://gist.github.com/pulsar256/f5621e85ef50711adc6f