【发布时间】:2020-11-22 19:44:15
【问题描述】:
我正在尝试使用 Youtube 数据 api -v3 playlistItems 获取一些数据。我能够完美地获取playlistItems 附带的所有数据。但是,我需要比playlistItems 提供的更多的数据。例如,我想获取查看次数、评论次数和所有统计信息
我知道我可以使用/youtube/v3/videos 来获取统计信息,但我一直在尝试,但它对我不起作用。请帮忙。谢谢。
export function buildVideosRequest(amount = 12, loadDescription = false, nextPageToken) {
let fields = 'nextPageToken,prevPageToken,items(contentDetails/videoId,id,snippet(channelId,channelTitle,publishedAt,thumbnails/medium,title)),pageInfo(totalResults)';
if (loadDescription) {
fields += ',items/snippet/description';
}
return buildApiRequest('GET',
'/youtube/v3/playlistItems',
{
part: 'snippet,contentDetails',
maxResults: amount,
playlistId: 'PLvahqwMqN4M0zIUkkXUW1JOgBARhbIz2e',
pageToken: nextPageToken,
fields,
}, null);
}
【问题讨论】:
标签: javascript reactjs react-redux youtube-data-api redux-saga