PlaylistItems: list 返回与 API 请求参数匹配的播放列表项的集合。
{
"kind": "youtube#playlistItemListResponse",
"etag": etag,
"nextPageToken": string,
"prevPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
playlistItem Resource
]
}
每个playlistItem Resource 都包含有关播放列表项的信息。
{
"kind": "youtube#playlistItem",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
},
"channelTitle": string,
"playlistId": string,
"position": unsigned integer,
"resourceId": {
"kind": string,
"videoId": string,
}
},
"contentDetails": {
"videoId": string,
"startAt": string,
"endAt": string,
"note": string,
"videoPublishedAt": datetime
},
"status": {
"privacyStatus": string
}
}
其中包含一个可用于运行的 videoId Videos: getRating 检索授权用户对指定视频列表的评分。
function videosGetRating($service, $id, $params) {
$params = array_filter($params);
$response = $service->videos->getRating(
$id,
$params
);
print_r($response);
}
videosGetRating($service,
'Ks-_Mh1QhMc,c0KYU2j0TM4,eIho2S0ZahI',
array('onBehalfOfContentOwner' => ''));