0
我得到這個錯誤波紋管,經過測試視頻上傳至YouTube視頻上傳至YouTube與C#的ASP.NET MVC
{"The remote server returned an error: (401) Unauthorized."}
我不知道有什麼錯我的代碼...
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");
var createdVideo = request.Upload(newVideo);
return View();
}
我在我的配置中添加了* localhost *,127.0.0.1和*作爲可接受的HTTP引用。
Can有人能幫助我嗎?
在嘗試之前,您是否通過API登錄過用戶? 401只是告訴你,該網站不知道你是誰,所以它不會滿足你的要求。 API密鑰就在那裏,所以API本身知道誰在打電話。 – Reisclef
我之前嘗試過,現在我重新創建並沒有任何內容:/ –