YouTube API v3,如何获取视频资源的文件详细信息(文件名等)? [英] YouTube API v3, How to Get fileDetails (filename, etc) for a videoresource?

查看:42
本文介绍了YouTube API v3,如何获取视频资源的文件详细信息(文件名等)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 YouTube API v3 中,我试图获取我自己频道上各种视频的文件详细信息(文件名等).

In YouTube API v3, I'm trying to get fileDetails (filename, etc) for the various videos on my own channel.

此链接 https://developers.google.com/youtube/v3/docs/视频(向下滚动到fileDetails")...

This link https://developers.google.com/youtube/v3/docs/videos (scroll down to "fileDetails") ...

fileDetails 对象封装了有关上传到 YouTube 的视频文件的信息,包括文件的分辨率、持续时间、音频和视频编解码器、流比特率等.这些数据只能由视频所有者检索."

"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."

... 表明您需要成为视频所有者,我是.

... suggests you need to be the video owner, which I AM.

尽管进行了数小时的研究和试验,我仍然不明白我需要从哪里获取我的所有者 ID,以及我必须在哪里使用它.

Despite many hours researching and some experimenting, I still don't understand where I need to get my owner id from, and where I have to use it.

希望有人能帮忙.

提前致谢.

推荐答案

fileDetails 可能不适用于所有视频,但适用于拥有它的视频,

fileDetails may not be available for all the videos, but for the ones that have it,

  • 您需要获得授权的视频->列表调用,同时part 字段 为该视频设置了fileDetails"和 videoId.
  • you need to have an authorized videos->list call while part field has "fileDetails" and videoId set to that video.

您的应用需要为其实施OAuth2.

Your application needs to implement OAuth2 for it.

您可以使用 API 浏览器轻松试用此功能.在右上角,打开授权开关并从对话窗口授权请求.然后你可以设置 part = fileDetails 和 id = VIDEO_ID

You can easily try this functionality with API explorer. On the top right corner, turn on the Authorization switch and authorize the request from the dialog window. Then you can set part = fileDetails and id = VIDEO_ID

这篇关于YouTube API v3,如何获取视频资源的文件详细信息(文件名等)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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