Youtube api “的区别是什么?”;发布视频“;及;上载“;在YouTube频道?如何通过YouTube数据v3 API获取这些数据? 我正在使用YouTube数据V3API开发YouTube客户端,正在播放两个不同的频道:

Youtube api “的区别是什么?”;发布视频“;及;上载“;在YouTube频道?如何通过YouTube数据v3 API获取这些数据? 我正在使用YouTube数据V3API开发YouTube客户端,正在播放两个不同的频道:,youtube-api,Youtube Api,在GoPro频道,我还可以选择一个视频过滤器:“上传”、“喜欢”和“发布视频”。我对“上传”和“发布视频”过滤器感到非常困惑,根据我的观察,在这个频道上,它们给出了相同的结果。但在YouTube策划的体育频道中,只有“发布视频”选项 在过去的几个小时里,我无法从YouTube v2/v3的API文档中找到任何明确的解释,更让我困扰的是,我找不到任何API来检索这些频道中的视频输入数据 对于Go Pro频道,我至少可以依靠这里提到的方法获得上传的视频: 但对于策展频道,即使此方法不起作用,频道查询

在GoPro频道,我还可以选择一个视频过滤器:“上传”、“喜欢”和“发布视频”。我对“上传”和“发布视频”过滤器感到非常困惑,根据我的观察,在这个频道上,它们给出了相同的结果。但在YouTube策划的体育频道中,只有“发布视频”选项

在过去的几个小时里,我无法从YouTube v2/v3的API文档中找到任何明确的解释,更让我困扰的是,我找不到任何API来检索这些频道中的视频输入数据

对于Go Pro频道,我至少可以依靠这里提到的方法获得上传的视频:

但对于策展频道,即使此方法不起作用,频道查询结果中给出的播放列表始终为空:

Request


GET https://www.googleapis.com/youtube/v3/channels?part=id%2CcontentDetails%2Csnippet&id=UCEgdi0XIXXZ-qJOFPf4JSKw&key={YOUR_API_KEY}

Authorization:  Bearer ya29.dwCMU6xpf5N9AxwAAABgIM94lgv7jGHw0h0oEjs6uZUdPFO28CDYhbvgXdKTjw
X-JavaScript-User-Agent:  Google APIs Explorer


Response


200 OK

- Show headers -

{
 "kind": "youtube#channelListResponse",
 "etag": "\"WFPuK6TsnblcGPcnMex79s42ynQ/qpdedwjxXQ-COrk0dODO-8DTAx0\"",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 1
 },
 "items": [
  {

   "kind": "youtube#channel",
   "etag": "\"WFPuK6TsnblcGPcnMex79s42ynQ/TP96YXZ0G4VPdQ7fd2IYgW79rW0\"",
   "id": "UCEgdi0XIXXZ-qJOFPf4JSKw",
   "snippet": {
    "title": "Sports",
    "description": "Sport is all forms of usually competitive physical activity which, through casual or organised participation, aim to use, maintain or improve physical ability and skills while providing entertainment to participants, and in some cases, spectators. Hundreds of sports exist, from those requiring only two participants, through to those with hundreds of simultaneous participants, either in teams or competing as individuals. Sport is generally recognised as activities which are based in physical athleticism or physical dexterity, with the largest major competitions such as the Olympic Games admitting only sports meeting this definition, and other organisations such as the Council of Europe using definitions precluding activities without a physical element from classification as sports. However, a number of competitive, but non-physical, activities claim recognition as mind sports.\nThis channel was generated automatically by YouTube's video discovery system.",
    "publishedAt": "2013-12-15T20:39:04.000Z",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/i/Egdi0XIXXZ-qJOFPf4JSKw/1.jpg"
     },
     "medium": {
      "url": "https://i.ytimg.com/i/Egdi0XIXXZ-qJOFPf4JSKw/mq1.jpg"
     },
     "high": {
      "url": "https://i.ytimg.com/i/Egdi0XIXXZ-qJOFPf4JSKw/hq1.jpg"
     }
    }
   },
   "contentDetails": {
    "relatedPlaylists": {
     "likes": "LLEgdi0XIXXZ-qJOFPf4JSKw",
     "uploads": "UUEgdi0XIXXZ-qJOFPf4JSKw"
    }
   }
  }
 ]
}
--


在我看来,这是一条死胡同,那么有没有办法从此类策划频道获取视频?

如果您已经获得策划频道的频道ID,您可以使用搜索端点获取视频;例如,此API调用将接收添加到YouTube体育频道的50个最新视频:

https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCEgdi0XIXXZ-qJOFPf4JSKw&maxResults=50&order=date&key={YOUR_API_KEY}

谢谢,您的示例API调用确实输出了一些结果,但目前,它们与官方频道内容完全不同()对此行为有何想法?更新,在使用提供的API调用更仔细地阅读搜索结果后,它只是将此频道下的所有播放列表项甩给了我,而不是我想要的视频。如果我强迫它列出视频条目,它会再次给我空结果。
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCEgdi0XIXXZ-qJOFPf4JSKw&maxResults=50&order=date&key={YOUR_API_KEY}