Youtube 数据订阅 API V3 在使用 mySubscribers 提交时不返回 NextPage [英] Youtube Data Subscription API V3 not returning NextPage when submitted with mySubscribers

查看:23
本文介绍了Youtube 数据订阅 API V3 在使用 mySubscribers 提交时不返回 NextPage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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:

请求:

https://www.googleapis.com/youtube/v3/subscriptions?onBehalfOfContentOwner=xxxx&onBehalfOfContentOwnerChannel=xxxxxxxxxxx&fields=items(contentDetails,id,snippet(publishedAt,channelId),subscriberSnippet(title,description)),nextPageToken,pageInfo,tokenPagination&5mySubscribers=true&part=id,snippet,contentDetails,subscriberSnippet&key=xxxxxxxxxxxxxxxx&alt=json

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

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"}, {片段":{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、总结果":144403}}

{"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}}

推荐答案

Known"(希望 Google 也知道)错误:

"Known" (Hopefully also to Google) bug:

https://code.google.com/p/gdata-issues/issues/detail?id=7163youtube.subscriptions.list (api v3) - nextPageToken 不可用

暂时,我想出了一个令牌生成器作为解决方法(请参阅其他 SO 帖子,或在这里:https://gist.github.com/pulsar256/f5621e85ef50711adc6f)

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)

这篇关于Youtube 数据订阅 API V3 在使用 mySubscribers 提交时不返回 NextPage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆