我正在使用以下代碼將視頻上傳到YouTube。 它總是給出以下錯誤。將視頻上傳到YouTube時出錯
The remote server returned an error: (403) Forbidden.
我的代碼是
YouTubeRequestSettings settings;
YouTubeRequest request;
string devkey = YouTubeDeveloperKey;
string username = YoutubeUserName;
string password = YoutubePassword;
settings = new YouTubeRequestSettings("VideoEditor", devkey, username, password) { Timeout = -1 };
request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = Title;
newVideo.Description = Description;
newVideo.Private = true;
newVideo.YouTubeEntry.Private = false;
newVideo.YouTubeEntry.MediaSource = new MediaFileSource(FilePath, "video/flv");
Video createdVideo = request.Upload(newVideo);
請你對這個錯誤
你可以顯示返回的xml嗎? –
如何獲得XML?它在線上發生錯誤Video createdVideo = request.Upload(newVideo); – las
在該行設置一個斷點並「跳入」代碼。 –