我使用了错误的方法来检索播放列表视频ID。使用的方法是playlistItems:
// Node.jsconst { google } = require('googleapis');const youtube = google.youtube('v3');const secrets = require('./secrets.json');youtube.playlistItems.list({ key: secrets.web.api_key, part: 'id,snippet', playlistId: 'PLvxLmGsmqdZc-GYVeLhS0N_6jfrzEleQm', maxResult: 10,}, (err, results) => { console.log(err ? err.message : results.items[0].snippet);});结果:
{ publishedAt: '2017-01-21T13:16:09.000Z', channelId: 'UCSD9RekiljT4DzK_6VvYY6A', title: 'Monster (feat. Jay-Z, Nicki Minaj, Rick Ross, Bon Iver)', description: 'Oficial', thumbnails: { default: { url: 'https://i.ytimg.com/vi/EOpQdJ5F5TI/default.jpg', width: 120, height: 90 }, medium: { url: 'https://i.ytimg.com/vi/EOpQdJ5F5TI/mqdefault.jpg', width: 320, height: 180 }, high: { url: 'https://i.ytimg.com/vi/EOpQdJ5F5TI/hqdefault.jpg', width: 480, height: 360 }, standard: { url: 'https://i.ytimg.com/vi/EOpQdJ5F5TI/sddefault.jpg', width: 640, height: 480 } }, channelTitle: 'Sergey Bondarenko', playlistId: 'PLvxLmGsmqdZc-GYVeLhS0N_6jfrzEleQm', position: 0, resourceId: { kind: 'youtube#video', videoId: 'EOpQdJ5F5TI' } }


