0
我想上傳視頻到我的ASP.net網站到YouTube使用數據API,但我得到這個錯誤:「遠程服務器返回錯誤:(403)禁止。「上傳視頻從asp.net網站的YouTube數據api
我使用下面的代碼:
YouTubeRequestSettings設置新= YouTubeRequestSettings( 「VideoPortal」, 「Developer_Key開發」, 「用戶名」, 「口令」); YouTubeRequest請求=新的YouTubeRequest(設置);
視頻newVideo = new Video();
newVideo.Title = "testvideo";//txttitle.Text.Trim();
newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "testvideo";//txtkeyword.Text.Trim();
newVideo.Description = "testvideodesc";//txtdesc.Text.Trim();
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");
string path = Server.MapPath("video/Screen-Recording.mov");
newVideo.YouTubeEntry.MediaSource = new MediaFileSource(path,
"video/quicktime");
settings.Timeout = 100000000;
Video createdVideo = request.Upload(newVideo);
任何人都可以請我建議我如何使這段代碼工作並解決錯誤?