views:

82

answers:

2

Hello experts,

I would be obliged, if you could kindly let me know the means by which I can retrieve the youtube thumbnails using Google API Client Library for Java, similar to the way in which we fetched thumbnails using gdata.

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

Looking forward, Regards, Rony

A: 

Hello, Can anyone please say the place to post this query, so that I may get an apt solution. I was being recommended to post my queries in this particular tab, by the api site themselves.

A: 

Using the example URL from the reference page:

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

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

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

You can modify the sample classes to parse the thumbnail object.

Brian
Hi,Many thanks for your reply. Not sure, whether I am posting trivial questions. Kindly refer YouTubeManager source code in http://www.javacodegeeks.com/2010/05/getting-started-with-youtube-java-api.html . I am searching for a similar method wherein I can retrieve the thumbnails pertaining to the general search, say, if I search most viewed videos using http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed , I get thumbnails corresponding to each video from that method. I am not finding any alternative classes for mediaContent, mediagroup etc. to obtain the result that i need.