Google YouTube API(v3):如何从服务器访问我的不公开/私人视频? [英] Google YouTube API (v3): how to access my unlisted/private videos from my server?

查看:193
本文介绍了Google YouTube API(v3):如何从服务器访问我的不公开/私人视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试Google YouTube API(v3).
直到今天,我还是将其用于公开视频.
现在,我需要处理未列出的视频(例如,检索频道中我上传的视频的列表).
我在文档中看到应该使用 google-api-php-client 库.
该库需要OAuth 2.0客户端ID. 该库需要来自客户端的交互式授权(当然是oauth2.实际上,代码示例中总是包含 html 部分.

I've been experimenting with Google YouTube API (v3).
Until today, I used it with public videos.
Now I have the requirement to work with unlisted videos (for example, retrieve the list of my uploaded videos on a channel).
I see in the docs I should use google-api-php-client libraries.
This library requires an OAuth 2.0 client ID. This library requires interactive authorization from client (it's oauth2, of course. Actually in the code samples is always included an html section.

现在的问题是:

我需要访问我的不公开(或可能是私有)的视频服务器端:我需要一个无人值守服务器到服务器身份验证. 是否有可能?如果是,那怎么办?

I need to access to my unlisted (or private, possibly) videos server-side: I would need an unattended, server-to-server kind of authentication. Is it possible? If it is, then how?

推荐答案

您可以在服务器中保存刷新令牌,并从那里请求新的访问令牌.

You can save a refresh token in your server and request new access tokens from there going forward.

否则,仅当您有权访问Content ID API时,才可以使用服务帐户和onBehalfofContentOwner参数.

Otherwise, only if you have access to Content ID API, you can use service accounts and onBehalfofContentOwner parameter instead.

这篇关于Google YouTube API(v3):如何从服务器访问我的不公开/私人视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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