响应中缺少 YouTube API V3 记录详细信息对象 [英] YouTube API V3 recordingDetails object missing in the response
问题描述
我今天从 curl 尝试了这个 YouTube API v3 调用:
I have tried this YouTube API v3 call from curl today:
http://www.googleapis.com/youtube/v3/videos?id=ZCJgvabihQ8&key=apiKey&part=snippet,recordingDetails
其他一切都很好,但我在响应json中没有找到recordingDetails对象:
Everything else is fine, but I didn't find the recordingDetails object in the response json:
{
"kind":"youtube#videoListResponse",
"etag":"\"oLweQuB9Vh7wAB9a0AIHg_K-wsM/EuRsJ-sxI3qstP1T58S5Qnb_NIg\"",
"items":[
{
"id":"ZCJgvabihQ8",
"kind":"youtube#video",
"etag":"\"oLweQuB9Vh7wAB9a0AIHg_K-wsM/CYNTRL05S4okPzkUfE5LbrRKt9g\"",
"snippet":{
"publishedAt":"2013-01-25T13:36:19.000Z",
"channelId":"UCpVm7bg6pXKo1Pr6k5kxG9A",
"title":"Weird Nature: Pink Dolphins?",
"description":"Up to 9 feet long and weighing up to 300 pounds, pink river dolphins are the largest freshwater dolphins in the world.",
"thumbnails":{
"default":{
"url":"https://i.ytimg.com/vi/ZCJgvabihQ8/default.jpg"
},
"medium":{
"url":"https://i.ytimg.com/vi/ZCJgvabihQ8/mqdefault.jpg"
},
"high":{
"url":"https://i.ytimg.com/vi/ZCJgvabihQ8/hqdefault.jpg"
}
},
"categoryId":"24"
}
}
]
}
有什么我错过的吗?非常感谢.
Is there anything I missed? Many thanks.
推荐答案
recordingDetails 并非对所有视频都是公开的,因此如果视频没有这些可用属性,则不会返回任何内容.通过不返回任何内容,YouTube 可以节省带宽并且响应时间可以更快.
recordingDetails is not public for all videos, so if a video doesn't have these attributes available, nothing will be returned. By not returning anything, YouTube saves bandwidth and the response time can be faster.
原回复:
这看起来像是一个合法的错误...
This looks like a legitimate bug...
recordingDetails 被列为视频资源的一个选项概览页面,但未在视频列表方法中列为有效部分此处:https://developers.google.com/youtube/v3/docs/videos/列表
recordingDetails is listed as an option on the videos resource overview page, but not listed as a valid part in the video list method here: https://developers.google.com/youtube/v3/docs/videos/list
通常,当您尝试使用无效部件时,您会得到400 Bad请求"错误,但 RecordingDetails 仍然返回 200 响应,所以看来真的该退货了……
Normally when you try using an invalid part you get a "400 Bad Request" error, but recordingDetails still returns a 200 response, so it looks like it really is supposed to be returned...
您应该在此处提交错误报告:https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Defect%20Report)
You should submit a bug report here: https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Defect%20Report)
这篇关于响应中缺少 YouTube API V3 记录详细信息对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!