当我在 Google App 脚本中使用 Youtube.Playlists.list 时,我遇到了一个错误,上面写着“ReferenceError:“Youtube”未定义”。我启用了 Youtube Analytics API 和 Youtube Data API,但错误仍然出现。我可以知道我怎样才能完成这项工作吗?
function myFunction() {
var playlistResponse = Youtube.Playlists.list('snippet',{
mine: true,
maxResults: 30,
pageToken: nextPageToken
});
for (var x = 0; x < playlistResponse.items.length; x++)
{
var playlistItem = playlistResponse.items[x];
var playlistId = playlistResponse.items.id;
var playlistTitle = playlistResponse.items.snippet;
Logger.log(playlistTitle);
Logger.log(playlistId);
}
}