How to get youtube thumbnails using the Google API client library for Java

I would be obligated if you would kindly tell me about the means by which I can get youtube thumbnails using the Google API client library for Java, similar to how we extracted thumbnails using gdata.

List<String> thumbnails = new LinkedList<String>();
for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) {
    thumbnails.add(mediaThumbnail.getUrl());
}

Expecting, Regards, Roni

+5
source share
1 answer

Using the sample URL from the man page :

URL: http://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2&alt=jsonc

we can extract an example of one of the relevant parts of JSON:

"thumbnail": {
    "sqDefault":"http://i.ytimg.com/vi/PpUgUrU5XUA/default.jpg",
    "hqDefault":"http://i.ytimg.com/vi/PpUgUrU5XUA/hqdefault.jpg"
}

.

+4

All Articles