Youtube API 播放列表未返回播放列表

Youtube API Playlists not returning the Playlist

我正在使用 Youtube API 的播放列表端点从特定频道获取播放列表,但它不适用于以下频道:

https://www.youtube.com/channel/UCX5fyLRcU05DMa2OVu-qFEQ

https://www.youtube.com/channel/UCwm2mdiUXApmL5bCxHtgJIA

我正在使用的查询:

https://www.googleapis.com/youtube/v3/playlists?channelId=UCwm2mdiUXApmL5bCxHtgJIA&part=snippet&order=date&maxResults=50&key=YOUR_API_KEY

https://www.googleapis.com/youtube/v3/playlists?channelId=UCX5fyLRcU05DMa2OVu-qFEQ&part=snippet&order=date&maxResults=50&key=YOUR_API_KEY

当我尝试使用特定的播放列表 ID 定位这些频道中的播放列表时,它不会 return 视频。我可以看到这些频道、播放列表和视频 public 并且可以搜索。

有什么理由 API 不应该 return 我丢失的这个播放列表吗?

感谢您的帮助。

巴尔图

如果您查看 playlist page of the channel you provided,您会发现那里发布的所有播放列表并非真正来自该频道 - 那些 added/generated 由 YouTube 本身发布。

示例:

https://www.youtube.com/playlist?list=OLAK5uy_nvZSUlZB8qwifPgIVCoEulF4VyErdBX48

一个普通的播放列表(属于频道)的ID应该如下:

PL3tRBEVW0hiB5KKP9gs_AkW8J4dOvbdPN

通过使用 YouTube 数据 API,您可以测试结果:

URL: https://youtube.googleapis.com/youtube/v3/playlists?part=id%2Csnippet%2Cstatus&id=OLAK5uy_nvZSUlZB8qwifPgIVCoEulF4VyErdBX48&key=[YOUR_API_KEY]

结果:

{
  "kind": "youtube#channelListResponse",
  "etag": "Yw1yJOOwI7LJ8LeYmvQ8wpyHWbU",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 5
  },
  "items": [
    {
      "kind": "youtube#channel",
      "etag": "wDhMSGEntArTZuX56hjNjytDUlU",
      "id": "UCFtEEv80fQVKkD4h1PF-Xqw",
      "snippet": {
        "title": "Microsoft",
        "description": "Innovation is a key ingredient in Microsoft’s mission: to empower every person and organization on the planet to achieve more. \n\nSubscribe to Microsoft's official YouTube channel to explore technology’s role in making the world more sustainable, inclusive, and innovative for all.\n\n",
        "customUrl": "microsoft",
        "publishedAt": "2006-02-13T05:21:44Z",
        "thumbnails": {
          "default": {
            "url": "https://yt3.ggpht.com/ytc/AKedOLRZENZBPyEEG2cd0PZXemKKyG1GMGVJXmzHhrs4=s88-c-k-c0x00ffffff-no-rj",
            "width": 88,
            "height": 88
          },
          "medium": {
            "url": "https://yt3.ggpht.com/ytc/AKedOLRZENZBPyEEG2cd0PZXemKKyG1GMGVJXmzHhrs4=s240-c-k-c0x00ffffff-no-rj",
            "width": 240,
            "height": 240
          },
          "high": {
            "url": "https://yt3.ggpht.com/ytc/AKedOLRZENZBPyEEG2cd0PZXemKKyG1GMGVJXmzHhrs4=s800-c-k-c0x00ffffff-no-rj",
            "width": 800,
            "height": 800
          }
        },
        "localized": {
          "title": "Microsoft",
          "description": "Innovation is a key ingredient in Microsoft’s mission: to empower every person and organization on the planet to achieve more. \n\nSubscribe to Microsoft's official YouTube channel to explore technology’s role in making the world more sustainable, inclusive, and innovative for all.\n\n"
        },
        "country": "US"
      },
      "contentDetails": {
        "relatedPlaylists": {
          "likes": "",
          "uploads": "UUFtEEv80fQVKkD4h1PF-Xqw"
        }
      },
      "status": {
        "privacyStatus": "public",
        "isLinked": true,
        "longUploadsStatus": "longUploadsUnspecified"
      }
    }
  ]
}

当您查询一个普通播放列表(属于该频道)时,您将得到这些结果:

URL: https://youtube.googleapis.com/youtube/v3/playlists?part=id%2Csnippet%2Cstatus&id=PL3tRBEVW0hiB5KKP9gs_AkW8J4dOvbdPN&key=[YOUR_API_KEY]

结果:

{
  "kind": "youtube#playlistListResponse",
  "etag": "OV6gnfMDH09mU3YBdHPuf5uz1Jg",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 5
  },
  "items": [
    {
      "kind": "youtube#playlist",
      "etag": "X8YVDKLXZZfHlVTh_ud0LD-IMMQ",
      "id": "PL3tRBEVW0hiB5KKP9gs_AkW8J4dOvbdPN",
      "snippet": {
        "publishedAt": "2016-05-15T15:29:30Z",
        "channelId": "UC7_YxT-KID8kRbqZo7MyscQ",
        "title": "DOOM",
        "description": "",
        "thumbnails": {
          "default": {
            "url": "https://i.ytimg.com/vi/pCygvprsgIk/default.jpg",
            "width": 120,
            "height": 90
          },
          "medium": {
            "url": "https://i.ytimg.com/vi/pCygvprsgIk/mqdefault.jpg",
            "width": 320,
            "height": 180
          },
          "high": {
            "url": "https://i.ytimg.com/vi/pCygvprsgIk/hqdefault.jpg",
            "width": 480,
            "height": 360
          },
          "standard": {
            "url": "https://i.ytimg.com/vi/pCygvprsgIk/sddefault.jpg",
            "width": 640,
            "height": 480
          },
          "maxres": {
            "url": "https://i.ytimg.com/vi/pCygvprsgIk/maxresdefault.jpg",
            "width": 1280,
            "height": 720
          }
        },
        "channelTitle": "Markiplier",
        "localized": {
          "title": "DOOM",
          "description": ""
        }
      },
      "status": {
        "privacyStatus": "public"
      }
    }
  ]
}

了解更多详情。