本文介绍了YouTube的API所有的特定类别的影片归来名单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来YouTube的REST API v3和我想看看是否有一种方法可以列出所有的视频​​在一个特定的类别。我已经能够得到最好的是这样的:

I'm new to the YouTube Rest API v3 and I'm trying to see if there's a way to list every video in a specific category. The best I've been able to get is this:

<一个href=\"https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&region$c$c=US&videoCategoryId=17&key=\" rel=\"nofollow\">https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&region$c$c=US&videoCategoryId=17&key={MY API KEY}

https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&regionCode=US&videoCategoryId=17&key={MY API KEY}

类别编号17等于体育(当然也有是这是很好的API响应分页)。现在的问题是,为了使用参数'videoCategoryID',我也是需要使用参数'图'和'图',那么唯一可以接受的值是'mostPopular根据此页:

category ID 17 is equal to 'Sports' (and of course there is pagination on the API response which is fine). The problem is that in order to use the parameter 'videoCategoryID', I also am required to use the parameter 'chart' and then only acceptable value for 'chart' is 'mostPopular' according to this page:

我不知道是否有一种方式来获得的视频在一个特定的类别列表(所有影片不只是最流行的)?

I'm wondering if there is a way to get a list of the videos in a specific category (all videos not just Most Popular)?

有是这样的堆栈溢出后,但它是YouTube的API V2(Getting在一个特定的类别所有YouTube视频)的完整列表。

There was this Stack Overflow post but it's for YouTube API v2 (Getting a complete list of all YouTube videos in a given category).

感谢您的帮助!

推荐答案

尝试搜索,为了只列出视频添加类型=视频
<一href=\"https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&videoCategoryId=17&key=\" rel=\"nofollow\">https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&videoCategoryId=17&key={YOUR API KEY}

Try search and add type=video in order to list just videoshttps://www.googleapis.com/youtube/v3/search?part=snippet&type=video&videoCategoryId=17&key={YOUR API KEY}

这篇关于YouTube的API所有的特定类别的影片归来名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 08:43