Tag: youtube data api

如何在YouTube用户上传video时拨打电话?

我正在尝试创建一个简单的聊天机器人,它会在某个频道上传video时发送消息,理想情况下是video的名称和video的超链接。 YouTube的API非常奇怪,我对如何处理这个问题一无所知。 这是我到目前为止: using System; using System.Linq; using Google.Apis.Services; using Google.Apis.YouTube.v3; YouTubeService service = new YouTubeService(new BaseClientService.Initializer() { ApiKey = apiKey, ApplicationName = “GoodApp” }); var getChannel = service.Channels.List(“snippet”); getChannel.Id = channelId; var response = getChannel.Execute(); var channel = response[0]; //now what?

错误:redirect_uri_mismatch在MVC应用程序中的Google登录

我正在尝试通过MVC C#应用程序将video上​​传到YouTube。 我正在关注此链接 每当我尝试运行该应用程序时,我都会收到来自Google的错误。 错误:redirect_uri_mismatch 请求中的重定向URI http:// localhost:52271 / authorize /与授权给OAuth客户端的URI不匹配。 访问https://console.developers.google.com/apis/credentials/oauthclient/CCC-XXX.apps.googleusercontent.com?project=XXXX以更新授权的重定向URI。 这是我的Json文件。 这是我的Google控制台应用程序: 错误: 有什么不对的吗 ? 谢谢。

YouTube V3 API – Google.Apis.Requests.RequestErrorBackend错误

后端错误[503]后端错误[503]后端错误[503]后端错误[503]

YouTube上传文件给我ArgumentNullException(C#)

我正在使用Google“Client Library for .NET”进行YouTube服务。 当我尝试上传video时,我的[Videos.Insert]请求中出现了错误。(System.ArgumentNullException)。 ArgumentNullException: Value cannot be null. Parameter name: baseUri 堆: в Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) в Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) в Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) в Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() в Google.Apis.Upload.ResumableUpload`1.d__e.MoveNext() в c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\[Media]\Upload\ResumableUpload.cs:строка 459 我的代码: X509Certificate2 certificate = new X509Certificate2(@”test.p12″, “notasecret”, X509KeyStorageFlags.Exportable); ServiceAccountCredential credential = new ServiceAccountCredential( new ServiceAccountCredential.Initializer(“test@developer.gserviceaccount.com”) { Scopes = new[] { YouTubeService.Scope.YoutubeUpload, YouTubeService.Scope.Youtube, YouTubeService.Scope.YoutubeReadonly } }.FromCertificate(certificate)); […]

使用适用于.NET的YouTube v3 Data API,如何获得刷新令牌?

我需要能够使用刷新令牌,以便在访问令牌过期后重新validation令牌。 如何使用C#v3 API执行此操作? 我查看了UserCredential类和AuthorizationCodeFlow类,没有任何内容向我跳出来。 我正在使用以下代码对其进行身份validation。 var result = await new AuthorizationCodeMvcApp(this, new AppFlowMetadata()). AuthorizeAsync(CancellationToken.None); if (result.Credential != null) { var service = new YouTubeService(new BaseClientService.Initializer { HttpClientInitializer = result.Credential, ApplicationName = “YouTube Upload Tool” }); } 这是我的AppFlowMetadata类。 public class AppFlowMetadata : FlowMetadata { private static readonly IAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer { ClientSecrets = […]

使用mvc应用程序将video上​​传到youtube(所有代码隐藏)

这真是太疯狂了,我花了一个星期的时间试图解决这个问题。 我发现的一切都被弃用或者不起作用。 所以这就是我想要做的。 我们让用户上传video,我们会将video存储到批准之前。 一旦获得批准,我们需要将其上传到我们的YouTube频道。 来自Google: https : //developers.google.com/youtube/v3/code_samples/dotnet#retrieve_my_uploads的示例将无法通过GoogleWebAuthorizationBroker.AuthorizeAsync,因为它只会永久挂起。 这种方法的另一个问题是我们在上传video后需要id,我们需要知道video是否成功上传,所有这些都是同步的。 你会看到它使用异步方法的代码,并获得video的id,有一个回调。 有没有人知道如何同步在mvc应用程序的后端上传video?