Search code examples
javayoutube-apigdatagdata-api

How to get the youtube last updated date using gdata java youtube api


I'm using gdata java client to load youtube video metadata. One of the key information I'm looking for is the published date and last updated date. Though I'm able to get the published date, the API doesn't seem to provide a handle for the last updated date.

I'm using the standard gdata API to retrieve information for the following link:


http://gdata.youtube.com/feeds/api/videos/_KqMmr_yhIs

As you can see, it has both, published and updated date information.

Here's the standard code I'm using :


YouTubeMediaGroup mediaGroup = videoEntry.getMediaGroup();
MediaPlayer mediaPlayer = mediaGroup.getPlayer();
System.out.println("Upload Time :"+mediaGroup.getUploaded());

The upload time returns the published date. Is there any way to get the updated date as well?

Any pointers will be appreciated.

Thanks,


Solution

  • My bad, I should have studied the APIs more.

    The updated date can be found from the VideoEntry class.

    
    videoEntry.getUpdated();
    

    Apologies for raising the question in haste.