0

uploading video using youtube api v3 throws:

An error prevented the upload from completing. The service youtube has thrown an exception: Google.GoogleApiException: Google.Apis.Requests.RequestError Backend Error [503] Errors [ Message[Backend Error] Location[ - ] Reason[backendError] Domain[global] ] at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Google.Apis.Upload.ResumableUpload1.d__e.MoveNext() in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\test\default\Src\GoogleApis\Apis[Media]\Upload\ResumableUpload.cs:line 459

this exception. I have no ida what it wants. When I'm going into debug it says:

can't found GoogleClientSecrets.cs and then NewtonsoftJsonSerializer.cs not found etc.

I have already used this code for upload but it has bugs.. So I'm using this: full code in pastebin. In

var secrets = GoogleClientSecrets.Load(stream).Secrets;

It says that can't find GoogleClientSecrets.cs

enter image description here

How can I solve that?

Everything is alright with client_secrets.json and my app is already registered in console.google.com I have don't upload yesterday but after 1 hour It throws this exception.. WTF does it needs?

I have tried this but same result

Community
  • 1
  • 1

1 Answers1

0

This simple code will work,

Video newVideo = new Video();

newVideo.Title ="My Test Movie";
newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "cars, funny";
newVideo.Description = "My description";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", 
  YouTubeNameTable.DeveloperTagSchema));

newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
// alternatively, you could just specify a descriptive string
// newVideo.YouTubeEntry.setYouTubeExtension("location", "Mountain View, CA");

newVideo.YouTubeEntry.MediaSource = new MediaFileSource("c:\\file.mov",
  "video/quicktime");
Video createdVideo = request.Upload(newVideo);

Reference : https://developers.google.com/youtube/2.0/developers_guide_dotnet?csw=1#Direct_Upload