Adding a YouTube video to a playlist throws an InvalidEntryException

I have a small AppEngine app that allows me to add YouTube videos to a YouTube playlist. The application uses the YouTube data API through the Java client library . The application did a great job until some problems appeared a few weeks ago, when the API was somehow changed, and gdata jars had to be updated to fix the problems. However, there is one chasm that continues to appear.

For some videos, the application raises an InvalidEntryException. Response body

<errors xmlns='http://schemas.google.com/g/2005'>
  <error>
    <domain>GData</domain>
    <code>InvalidEntryException</code>
    <internalReason>Validation failed</internalReason>
  </error>
</errors>

I could not find information about this error. Also, there seems to be no problem with the video.

Code responsible for adding video to the playlist:

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

service.insert.

+3
1

Google, . YouTube, . .

0

All Articles