Đây là mã của tôi:Tôi muốn xóa một đoạn video từ kênh của tôi trên Youtube bằng cách sử dụng API
YouTubeService serv = new YouTubeService("myDeleteService", YOUTUBE_DEVELOPER_KEY);
serv.setUserCredentials(USERNAME, PASSWORD);
YouTubeRequestSettings settings = new YouTubeRequestSettings(YOUTUBE_CHANNEL, YOUTUBE_DEVELOPER_KEY);
YouTubeRequest request = new YouTubeRequest(settings);
string feedUrl = String.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads", YOUTUBE_CHANNEL);
Feed<Video> videoFeed = request.Get<Video>(new Uri(feedUrl));
Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + VideoId);
Video video = request.Retrieve<Video>(videoEntryUrl);
Video vid = (from vi in videoFeed.Entries
where vi.VideoId == VideoId
select vi).First<Google.YouTube.Video>();
request.Delete(vid);
Các phá vỡ mã trên dòng cuối cùng tuyên bố rằng đối tượng tham chiếu không được thiết lập để một đối tượng.
Bất kỳ giải pháp nào? Tôi đã gặp phải vấn đề tương tự. –
Tôi cũng nhận được lỗi này. Giải pháp của bạn thực sự giúp tôi. +1 giúp bạn – Sukhjeevan