使用YoutubeApi v3和ouath2将视频上传到我的Youtube频道,无需用户身份验证 [英] Upload videos to my Youtube channel without user authentication using YoutubeApi v3 and ouath2
问题描述
我的任务目标是创建一个控制台脚本,它将在我自己的网站上将最近上传的视频插入我自己的Youtube频道。
我想使用服务器到服务器认证,但YoutubeApi现在不支持这种认证方式。所以我的问题是:如何在没有任何用户帮助的情况下使用控制台脚本使用oauth2身份验证,将视频上传到youtube频道?有没有办法做到这一点,而不使用不推荐使用ClientLogin身份验证协议?
是这部分解释如何:https://developers.google.com/youtube/v3/guides/moving_to_oauth#standalone
基本上,你会经历一次并从那里保存令牌。
如果你甚至想跳过那一次同样,您可以在 OAuth2 Playground 中使用受尊重的范围获取刷新令牌,并直接将其插入代码中,并保留客户端密码和id。这样您的脚本就不需要Web浏览器。 b
The goal of my task is to create a console script, which will insert recently uploaded videos on my own site to my own Youtube channel. I want to use server-to-server authentication but YoutubeApi does not support this way of authentication now.
So my question is: How could I upload video to youtube channel, using oauth2 authentication with console script without any help of a user? Is there any way to do this without using deprecated ClientLogin authentication protocol?
Yes this segment explains how to: https://developers.google.com/youtube/v3/guides/moving_to_oauth#standalone
Basically, you go through once and save the token from there.
If you even want to skip that one time as well, you can get a refresh token in OAuth2 Playground with respected scopes and plug it in directly in your code, with client secret and id. That way your script won't need a web browser.
Here's the video explaining this workflow step-by-step.
这篇关于使用YoutubeApi v3和ouath2将视频上传到我的Youtube频道,无需用户身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!