YouTube API .NET C# 编辑视频问题
我使用最新的 YouTube API 来上传用户的电影。上传有效,但之后编辑属性时遇到问题。我正在尝试这样:
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);
时,我收到一条错误,指出未找到对象 - 类似的情况。缺什么?
I use the newest YouTube API to upload movies by my users. Upload works but I have problem with editing properties after that. I'm trying like this:
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);
First of all video.ReadOnly = true
so I the object is uneditable. When I'm trying to perform request.Update(video);
I get an error that Object is not found - something like that. What is missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在 URL 上,
我已通过将 URL 更改为
“尝试一下”来解决该问题,它会正常工作。
The problem is with the URL
I have fixed the issue by changing the URL to
Try it and it will work fine.