3
我有一個小的AppEngine應用程序,使我可以將YouTube視頻添加到YouTube播放列表。該應用通過Java client library使用YouTube數據API。該應用程序運行良好,直到幾周前出現了一些問題,當時API發生了某種變化,並且需要更新gdata jars來解決問題。然而,還有一個不斷出現的殘餘bug。將YouTube視頻添加到播放列表中會引發InvalidEntryException
對於某些視頻,應用程序會拋出InvalidEntryException。 迴應主體
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>InvalidEntryException</code>
<internalReason>Validation failed</internalReason>
</error>
</errors>
我無法找到關於此錯誤的任何信息。另外,視頻似乎不存在問題。
代碼負責添加視頻到播放列表:當service.insert
被稱爲
String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/" + videoId;
VideoEntry videoEntry = service.getEntry(new URL(videoEntryUrl), VideoEntry.class);
PlaylistEntry playlistEntry = new PlaylistEntry(videoEntry);
String playlistURL = "http://gdata.youtube.com/feeds/api/playlists/" + playlistId;
service.insert(new URL(playlistURL), playlistEntry);
的錯誤是拋出。