Martin Horton
Martin Horton

Reputation: 858

Google YouTube API v3 fails

YouTube Data API: Upload Video

An error prevented the upload from completing. System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) at Google.Apis.Upload.ResumableUpload1.<UploadAsync>d__83.MoveNext() in C:\Users\mdril\Documents\GitHub\google-api-dotnet-client\Src\GoogleApis\Apis\[Media]\Upload\ResumableUpload.cs:line 378 An error prevented the upload from completing. System.ArgumentNullException: Value cannot be null. Parameter name: baseUri at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) at Google.Apis.Upload.ResumableUpload1.d__87.MoveNext() in C:\Users\mdril\Documents\GitHub\google-api-dotnet-client\Src\GoogleApis\Apis[Media]\Upload\ResumableUpload.cs:line 460 Press any key to continue...

I have copied the example code to upload a video to youtube and I have installed my client_secret.json file and it does present me with a choice of which account to use.

The only other change was to place the actual name of the video file

Can anyone please tell me what I am doing wrong?

Upvotes: 1

Views: 589

Answers (1)

Martin Horton
Martin Horton

Reputation: 858

After much searching I eventually then answer here. It turns out there was nothing wrong with the code but in order to upload to an account you MUST have created a YouTube Channel. While I can understand the restriction, it does occur to me that it could return a much more meaningful response. Judging by the amount of conversation it seems I am not the only one who had this problem.

Upvotes: 2

Related Questions