使用 YouTube 视频 API 时无法获取 fileDetails 部分 [英] Unable to get fileDetails part when using YouTube videos API

查看:23
本文介绍了使用 YouTube 视频 API 时无法获取 fileDetails 部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 YouTube API 从 YouTube 获取视频列表.我正在使用 API 密钥.当我使用下面的 URL 时,一切正常,我得到了想要的结果:获取 https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CcontentDetails&id=I6zuKbBlmRo&key={YOUR_API_KEY}

I am trying to get a list of videos from YouTube using YouTube API. I am using an API key. When I use the URL below everything works fine and I get the desired results: GET https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CcontentDetails&id=I6zuKbBlmRo&key={YOUR_API_KEY}

但是当我将 fileDetails 添加到 part 参数时,我收到了一个 403 forbidden 错误,这个响应是:获取 https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CcontentDetails%2CfileDetails&id=I6zuKbBlmRo&key={YOUR_API_KEY}

But when I add fileDetails to the part parameter, I get a 403 forbidden error with this response: GET https://www.googleapis.com/youtube/v3/videos?part=id%2Csnippet%2CcontentDetails%2CfileDetails&id=I6zuKbBlmRo&key={YOUR_API_KEY}

403 禁止

任何帮助将不胜感激.

谢谢

推荐答案

来自 YouTube APIv3 文档:

From YouTube APIv3 Docs:

    The **fileDetails** object encapsulates information about the video file that was   
    uploaded to YouTube, including the file's resolution, duration, audio and video 
    codecs, stream bitrates, and more. **This data can only be retrieved by the video owner.**

只有所有者才能获得这些属性.

Only the owner can get those properties.

这篇关于使用 YouTube 视频 API 时无法获取 fileDetails 部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆