如何通过 V3 .NET 使用 api 密钥将视频上传到 Youtube
我在使用 V2 时遇到了一些问题(错误代码 400),所以我正在尝试从 V2 迁移到 Youtube Api V3.
I have some issues with V2 (Error code 400) so I'm trying to move to Youtube Api V3 from V2.
我使用的是 C#,我一直在寻找如何使用 V3 .NET 上的 api 密钥将视频上传到 Youtube
I'm using C# and I've been searching how to upload videos to Youtube with api key on V3 .NET
在哪里可以找到相关的示例、说明或文档?
Where can i find an example,explanation or a document for that?
https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video
您需要通过 OAuth2.如果您尝试上传到自己的帐户,则此部分说明如何:https://developers.google.com/youtube/v3/guides/moving_to_oauth#standalone
You need to go through OAuth2. If you are trying to upload into your own account, then 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.
如果您甚至想跳过那一次,您可以在 OAuth2 中获取刷新令牌Playground 具有受尊重的范围,并将其直接插入到您的代码中,并带有客户端密钥和 ID.这样您的脚本就不需要网络浏览器了.
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.