2011-06-09 61 views
0

根据Google Youtube Java API,如果我想删除一个视频,首先是获取VideoEntry对象,然后调用它的删除;线程“main”中的异常java.lang.UnsupportedOperationException:不能删除条目

http://code.google.com/apis/youtube/2.0/developers_guide_java.html

文件称检索特定视频输入:

//My own function returns me the service Obj, and it works! 
YouTubeService service = getYoutubeService(); 
String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/MyVideoID"; 
VideoEntry videoEntry = service.getEntry(new URL(videoEntryUrl), VideoEntry.class); 

但是当我打电话DELET,它给了我异常

videoEntry.delete(); 

任何现在,我已经搞定了然后通过videoFeed.getEntries()列表循环查找VideoEntry与我传入的视频ID相同。

VideoFeed videoFeed = service.getFeed(new URL("http://gdata.youtube.com/feed/api/users/My Account/uploads"), VideoFeed.class); 

为什么videoFeed.getEntries()List中的VideoEntry Obj可以调用delete()函数,但不能调用service.getEntry函数返回的VideoEntry Obj?

+0

http://osdir.com/ml/youtube-api-gdata/2010-01/msg00122.html? – MJB 2011-06-09 05:07:33

+0

还有更多关于http://groups.jonzu.com/z_tag/delete/page/3/ – MJB 2011-06-09 05:09:38

+0

是的,谢谢!这实际上是我的网址错误!我应该将网址设置到我的帐户目录,然后我可以通过视频ID干脆删除视频干杯! – user711657 2011-06-09 05:26:49

回答

相关问题