【问题标题】:Exception in thread "main" java.lang.UnsupportedOperationException: Entry cannot be deleted线程“主”java.lang.UnsupportedOperationException 中的异常:无法删除条目
【发布时间】:2011-06-09 04:50:41
【问题描述】:

根据Google Youtube Java API,如果我想删除视频,首先是获取VideoEntry Object,然后调用它的delete;

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);

但是当我调用 delete 时,它​​给了我异常

videoEntry.delete();

现在,我必须获取提要,然后循环遍历 videoFeed.getEntries() 列表以查找 VideoEntry 与我传入的 videoID 相同。

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 不能调用????

【问题讨论】:

标签: java api youtube


【解决方案1】:

osdir.com/ml/youtube-api-gdata/2010-01/msg00122.html
还有更多关于groups.jonzu.com/z_tag/delete/page/3

暗示需要将 URL 设置为您的帐户目录。

【讨论】:

    猜你喜欢
    • 2014-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-10
    • 1970-01-01
    • 2016-12-05
    • 1970-01-01
    • 2014-02-12
    相关资源
    最近更新 更多