如何解决报告YouTube.Subscriptions.list API中的错误
由于YouTube API How to Get Help表示Google工程师监控,所以我将尝试在此处报告API错误。
问题似乎是YouTube.Subscriptions.list在页面请求之间刷新了已订阅频道的“相关性”顺序,导致频道列表不完整,重复次数很多。
使用下面的代码复制错误:
function SubscribedChannels()
{
var subscriptionList = [];
var nextPageToken = '';
// Store subscription list responses in an array
var subscriptionsResponse = [];
// Get new pages of subscribed channels until the next page pointer is empty
var i = 0;
while (nextPageToken != null) {
subscriptionsResponse[i] = YouTube.Subscriptions.list('snippet',maxResults: 50,mine: true,pageToken: nextPageToken
});
// Get the next page of results
nextPageToken = subscriptionsResponse[i].nextPageToken;
// Increment the pointer to move to the next array value
i++
}
解决方法是在请求参数中添加“ order:按字母顺序排列”,但按默认顺序获取列表也应可行。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。