YouTube 数据 API:无需用户干预即可使用 V3 对服务进行 OAuth 身份验证

问题描述:

我正在实施一项服务,一旦视频上传到不同的服务器上,该服务就会自动将视频上传到 YouTube 频道.

I'm implementing a service that automatically uploads videos to a YouTube channel once they are uploaded on a different server.

刚开始时,我使用的是 ClientLogin 身份验证和 YouTube API v2.0 – 直接上传 一切正常.但是,由于不推荐使用 ClientLogin,我正在尝试更新以使用 v3.0.

When I first started I was using ClientLogin authentication and YouTube API v2.0 – Direct Uploading and everything worked perfectly. However, since ClientLogin is deprecated, I'm trying to update to use v3.0.

我检查了此文档,它假定文件已存储本地,在我的情况下不是,并且此服务不会在我的本地计算机上运行,​​而且我无法获取 OAuth 2.0 的访问令牌.

I checked this documentation and it assumes that the file is stored locally, which in my case is not, and this service will not be running on my local machine, and I'm not able to get the access token for OAuth 2.0.

有人可以提供指导吗?

您可以通过从 OAuth2 Playground 并将其设置在您的 youtube 对象中.

You can do so by getting a refresh token from OAuth2 Playground and setting it in your youtube object.

这里有更多说明.

以及分步视频.