Monday, May 17, 2010

Java YouTube Developers: Update Your Libraries

If you access the YouTube API via Java using the official Google Data Client Library, we want to let you know about upcoming changes to the YouTube API that may affect your existing code. Developers who are using a client library in a language other than Java, or who use Java but access the YouTube API without using the Google Data Client Library will not be affected by this change.

Versions of the Java Google Data Client Library earlier than 1.41.2 (the most recent release as of this writing) are particularly picky about the data they receive back from the YouTube API and deserialize into Java objects. If our YouTube API servers are updated to start including an additional attribute for an existing element in their Atom XML responses, older versions of the Java client library will throw a deserialization exception complaining about this extra data. While this might be considered beneficial in some contexts, it unfortunately precludes our ability to extend the YouTube API’s functionality by returning back new data in its responses. We recently ran into this issue while trying to launch a new totalUploadViews attribute, for instance.

We removed the totalUploadViews attribute soon after adding it, but progress can’t be delayed forever. If you’re using the Java Google Data Client Library, we strongly recommend that you update your installation to the 1.41.2 (or newer) release. We plan on re-adding the totalUploadViews attribute in mid-July, and other new attributes may follow. If you haven’t updated to a compatible version of the Java client library by mid-July, your existing Java code will start throwing exceptions when you retrieve an Atom XML response containing the new attribute, such as a request for a user’s YouTube profile.

A special note to developers using YouTube Direct: because YouTube Direct is built on top of the Java client library, it also needs to be updated to use a compatible release. The latest archived downloads of the source code for both the 1.0 and 2.0 releases, as well as the SVN source, have been updated for compatibility. Please take the time to update your YouTube Direct deployment in App Engine before mid-July.

Cheers,
—Jeff Posnick, YouTube API Team
YouTube is hiring! ~ http://google.com/jobs/workyoutube