YouTube の動画にコメントを追加しようとしていますが、コメントを追加する動画を取得しているときに、YouTube から次のエラーが送信されることがあります: リクエストの実行に失敗しました: http://gdata.youtube.com/feeds /api/videos/ceVlltPBcHg/コメント
例外の内部メッセージは、「リモート サーバーがエラーを返しました: (403) Forbidden」です。
public bool commentVideo(string videoId)
{
Uri Url = new Uri("http://gdata.youtube.com/feeds/api/videos/" + videoId);
YouTubeRequestSettings s = new YouTubeRequestSettings(AppName, ApiKey,UserName,
Password);
s.Timeout = 10000000;
YouTubeRequest account = new YouTubeRequest(s);
account.Proxy = GetProxyForUser(user);
Video video = account.Retrieve<Video>(Url);//some times got exception
string rating = commentRepository.getRating();
Comment c = new Comment();
c.Content = commentRepository.getComment();
account.AddComment(video, c);
Console.WriteLine("Comment successfully added to : " + videoId);
return true;
}
私のコードで何が間違っていますか?