New issue 580 by mar...@gmail.com: YouTube API Delete Video Problem .Net
http://code.google.com/p/google-gdata/issues/detail?id=580
Hi, the Visual Studio C# reports object reference not set to an instance of
an object when trying to delete a video by using:
Uri videoEntryUrl = new
Uri("http://gdata.youtube.com/feeds/api/videos/11111111111");
Video video = request.Retrieve<Video>(videoEntryUrl);
//YOUTUBE BUG>>>
request.Delete(video);
i have check and video exists and its not null
descriptions also here
http://stackoverflow.com/questions/8712305/i-want-to-delete-a-video-from-my-channel-on-youtube-using-the-api
Comment #1 on issue 580 by ccherub...@google.com: YouTube API Delete Video
Problem .Net
http://code.google.com/p/google-gdata/issues/detail?id=580
The Delete method works as expected if you use the right url, i.e. the one
from the /upload feed.
The entries in the /videos feed do not have an edit url which is the one
that must be used to send a delete request. I just updated the library
(rev. 1169) to return a more meaningful ArgumentNullException instead of
the generic null reference.
Please use this code to delete a video you uploaded:
YouTubeRequestSettings settings = new
YouTubeRequestSettings(YOUTUBE_CHANNEL, YOUTUBE_DEVELOPER_KEY, USERNAME,
PASSWORD);
YouTubeRequest request = new YouTubeRequest(settings);
Uri videoEntryUrl = new
Uri(String.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads/{1}",
YOUTUBE_CHANNEL, VIDEO_ID));
Video video = request.Retrieve<Video>(videoEntryUrl);
request.Delete(video);
thank you !