Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
YouTube API.NET C#编辑视频问题_.net_Api_Video_Youtube_Edit - Fatal编程技术网

YouTube API.NET C#编辑视频问题

YouTube API.NET C#编辑视频问题,.net,api,video,youtube,edit,.net,Api,Video,Youtube,Edit,我使用最新的YouTube API上传用户的电影。上传工作,但我有编辑后的属性问题。我试着这样做: YouTubeRequestSettings settings = new YouTubeRequestSettings("NETUnittests", YTDeveloperKey, YTUser, YTPassword); settings.Timeout = 10000000; YouTubeRequest request = new YouTubeRequest(settings); G

我使用最新的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);
YouTubeRequestSettings=newyoutuberequestsettings(“NETUnittests”,YTDeveloperKey,YTUser,YTPassword);
设置。超时=10000000;
YouTuberRequest请求=新建YouTuberRequest(设置);
Google.YouTube.Video=new Google.YouTube.Video();
//video.VideoId=lblVideoID.Text;
//http://gdata.youtube.com/feeds/api/users/USER_ID/uploads/VIDEO_ID
Uri videoEntryUrl=新Uri(“http://gdata.youtube.com/feeds/api/videos/“+lblVideoID.Text);
video=request.Retrieve(videoEntryUrl);
如果(video.ReadOnly==false)
{
}
字符串tt=video.Title;
字符串dd=video.Description;
video.Title=tbTitle.Text;
video.Description=tbDescription.Text;
video.Keywords=tbKeywords.Text;
//video.Status.Value=“private”;
请求更新(视频);

首先,video.ReadOnly=true,因此该对象不可编辑。当我尝试执行request.Update(视频)时;我发现一个错误,就是找不到物体——诸如此类的东西。缺少什么?

问题在于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);
试试看,它会很好用的