Well, I can upload videos to Youtube, but I have not found a way or corresponding code to delete videos / videos from Youtube.
Here is my code that I tried to remove youtube video.
private async Task Run() { UserCredential credential; using (var stream = new FileStream("client_secret.json", FileMode.Open, FileAccess.Read)) { credential = await GoogleWebAuthorizationBroker.AuthorizeAsync( GoogleClientSecrets.Load(stream).Secrets, new[] { YouTubeService.Scope.Youtube }, "user", CancellationToken.None ); } var youtubeService = new YouTubeService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = Assembly.GetExecutingAssembly().GetName().Name }); var videosDeleteRequest = youtubeService.Videos.Delete("Video ID"); await videosDeleteRequest.ExecuteAsync(); }
But getting a response 403
Error: Google.Apis.Requests.RequestError Insufficient Permission [403] Errors [ Message[Insufficient Permission] Location[ - ] Reason[insufficientPermis sions] Domain[global] ]
A little help or any possible solution will be very noticeable.
Jyotish singh
source share