0
I’m trying to make an integration with Youtube, but I’m getting the error
{"The remote server returned an error: (401) Unauthorized."}
I released my key api as per the image below and I am testing this code below, someone could help me showing what is missing?
YouTubeRequestSettings settings = new YouTubeRequestSettings("VideoToYoutube", "AIzaSyBiXxL5nS6IjYRGJUhDdaYdWGqAGwOvD8A");
YouTubeRequest request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = "Teste";
newVideo.Tags.Add(new MediaCategory("teste", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "Teste";
newVideo.Description = "Teste";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("teste, teste",
YouTubeNameTable.DeveloperTagSchema));
newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
newVideo.YouTubeEntry.MediaSource = new MediaFileSource("C:\\Users\\tadriano\\Documents\\streaming\\mov_bbb.mp4", "video/mp4");
try
{
var createdVideo = request.Upload(newVideo);
}
catch (System.Exception ex)
{
var teste = ex.Message;
throw;
}
return View();
}
In HTTP referrers, it is not necessary to put the URL where this calling?
– Hiago Souza
I put localhost, localhost, 127.0.0.1 and nothing... so I left it blank for this last test.
– thiago.adriano26