2011-05-09 108 views
1

我使用最新的YouTube API上傳我的用戶的電影。上傳工作,但我有編輯後的屬性問題。我想這樣:YouTube API .NET C#編輯視頻問題

YouTubeRequestSettings settings = new YouTubeRequestSettings("NETUnittests", YTDeveloperKey, YTUser, YTPassword); 

settings.Timeout = 10000000; 
YouTubeRequest request = new YouTubeRequest(settings); 
Google.YouTube.Video video = new Google.YouTube.Video(); 
//video.VideoId = lblVideoID.Text; 

//http://gdata.youtube.com/feeds/api/users/USER_ID/uploads/VIDEO_ID 

Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + lblVideoID.Text); 
video = request.Retrieve<Google.YouTube.Video>(videoEntryUrl); 

if (video.ReadOnly == false) 
{ 

} 

string tt = video.Title; 
string dd = video.Description; 

video.Title = tbTitle.Text; 
video.Description = tbDescription.Text; 
video.Keywords = tbKeywords.Text; 

//video.Status.Value = "private"; 
request.Update(video); 

首先video.ReadOnly = true,所以我的對象是不可編輯的。當我試圖執行request.Update(video);我得到一個錯誤,沒有找到對象 - 這樣的。什麼不見​​了?

回答

0

的問題是與URL

Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + lblVideoID.Text); 

我已經通過更改URL固定問題

Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/users/default/uploads/" + lblVideoID.Text); 

嘗試它,它會正常工作。