API - 将 PHP 中的视频上传到特定频道 [英] API - Upload video in PHP to a specific Channel

查看:25
本文介绍了API - 将 PHP 中的视频上传到特定频道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们计划使用 YouTube API Data V3 来允许用户通过 PHP 将视频上传到我们的频道.我的问题是,允许将视频上传到我们的频道的服务器上的正确步骤是什么?我认为这是服务器或浏览器键发挥作用的地方吗?

We're planning on using the YouTube API Data V3 to allow users to upload videos to our channel via PHP. My question is, what are the correct steps in allowing the video to be uploaded on a server, to our Channel? I though that is where the Server or possibly Browser key would come into play?

目前,我可以上传视频,但在用户登录后,它会上传到他们的频道.我们是否需要存储我们希望将所有视频上传到的帐户生成的访问令牌?

Currently, I'm able to upload the video, but after the user signs in, it get's uploaded to their Channel. Do we need to store the access token generated by account that we want all the videos to be uploaded to?

推荐答案

您实际上可以在服务器帐户登录后保存刷新令牌并在代码中重复使用,而不是每次都登录用户.

You can actually save the refresh token once the account of your server signs in and reuse it in your code, rather than signing in a user every time.

>

您可以通过从 OAuth2 Playground 获取刷新令牌并将其设置在您的 youtube 对象中来实现.

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

这里有更多说明.

以及分步视频.

这篇关于API - 将 PHP 中的视频上传到特定频道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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