【发布时间】:2014-02-10 22:09:00
【问题描述】:
API 调用https://www.googleapis.com/youtube/v3/videoCategories?part=snippet®ionCode=US&key=API_KEY 可以检索某个国家/地区的可用 videoCategory 列表。
例如,videoCategory id 43:
但是,当我通过此 videoCategory id 43 检索视频时,例如https://www.googleapis.com/youtube/v3/videos?part=snippet%2C+contentDetails&chart=mostPopular®ionCode=MY&videoCategoryId=43&key=API_KEY,我得到了错误:
乍一看,我以为是由于assignable为false,但事实并非如此,因为一些assignable=false的videoCategoryId也可以检索视频。
videoCategoryId id 30,assignable 为 false:
videoCategoryId 30 获取视频没有问题:
搜索 API 没问题(某些类别仅返回 ~2 个视频),例如此 API 调用,https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&maxResults=20&order=relevance&videoCategoryId=43&type=video&key=API_KEY:
我不确定这是否是错误。因为有可能 videoCategory id 43 不在 mostPopular 图表下并导致此错误。但是如何在 videoCategories 资源 API 上检测和过滤掉它呢?没有标志表明此类别不能与视频资源 API 一起使用。
【问题讨论】:
标签: youtube youtube-api