1

I am under implementing the application for searching YouTube EDU content using YouTube Data API V3. I used below API for searching YouTube Contents, but I faced two problems.

The first, I want to display not only title but also author, view count and total playing time. When I use the 'part=snippet', these information is no exist in the result metadata. So, I try to use other things that allowed at the 'part' and I get the below result.

  • snippet : Well done, but author, view count and total time are not included.
  • contentDetails : 400 Bad Request
  • player : 400 Bad Request
  • statistics : 400 Bad Request
  • status : 400 Bad Request

The second, I want to search the contents within specific YouTube EDU category. but, I can't find the proper channel_ID corresponding to 'Category' in the YouTube EDU API V2. I referenced the below URL for getting YouTube EDU category in the API V2.

Please, help me how to resolve these problems.

4

1 回答 1

3

part参数 in唯一支持的两个值youtube.search.list()是“snippet”和“id”。您需要做的是继续使用“片段”,然后获取每个结果的视频 ID(在 中searchResult.id.videoId),然后将最多 50 个视频 ID 传递到一个调用中,youtube.videos.list(part="snippet,statistics,contentDetails", id="id1,id2,id3,...")所以这是两个单独的 API 调用,即与我们在 YouTube Data API v3 中采用的方法一致。

与 v2 中的 YouTUbe EDU 类别对应的频道 ID 可能会在不久的将来发生变化,我不确定目前以编程方式查找的最佳方式是什么。我们应该在未来提供一些关于这方面的指导,我建议遵循 Data API v3修订历史

于 2013-08-07T13:21:00.560 回答