YouTube API搜索视频返回播放列表项

时间:2018-02-08 10:56:00

标签: google-api youtube-api youtube-data-api

即使我将“type”设置为“video”以仅返回视频,我在提出此请求时得到了“善意”youtube#playlist

YouTube Search.List

我明白了:

{
  "kind": "youtube#searchListResponse",
  "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/9VWjbEaR6eNH0YMYb_Dbc2fPG70\"",
  "nextPageToken": "CAEQAA",
  "regionCode": "FR",
  "pageInfo": {
    "totalResults": 1000000,
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#searchResult",
      "etag": "\"_gJQceDMxJ8gP-8T2HLXUoURK8c/YNUnc9nKZyCAIp2V_uVZhyg5tC0\"",
      "id": {
        "kind": "youtube#playlist",
        "playlistId": "PLJ49NV73ttrutlLqBBYmYyvPxzRft9q4s"
      },
      "snippet": {
        "publishedAt": "2017-12-08T20:07:17.000Z",
        "channelId": "UC4PooiX37Pld1T8J5SYT-SQ",
        "title": "Esther Povitsky, Spicy Candy Showdown & More! GMM #1255",
        "description": "Comedian Esther Povitsky helps us figure out the weird things people google, we boil your favorite songs down to their essence, we taste test the spiciest candies, and more!",
        "thumbnails": {
          "default": {
            "url": "https://i.ytimg.com/vi/_1HrNThkeKo/default.jpg",
            "width": 120,
            "height": 90
          },
          "medium": {
            "url": "https://i.ytimg.com/vi/_1HrNThkeKo/mqdefault.jpg",
            "width": 320,
            "height": 180
          },
          "high": {
            "url": "https://i.ytimg.com/vi/_1HrNThkeKo/hqdefault.jpg",
            "width": 480,
            "height": 360
          }
        },
        "channelTitle": "Good Mythical Morning",
        "liveBroadcastContent": "none"
      }
    }
  ]
}

知道为什么吗?

1 个答案:

答案 0 :(得分:2)

Youtube api Search

  

搜索结果包含有关YouTube视频,频道的信息,   或与API中指定的搜索参数匹配的播放列表   请求。搜索结果指向唯一可识别的   资源,就像一个视频,它没有自己的持久数据。

Search.list将返回视频,频道和播放列表的结果。

至于为什么查询资源管理器返回播放列表,这是一个错误,它没有应用所有参数。 issue