public static TubesFeed searchByKey(String key, int page, int type) {
TubesFeed result = new TubesFeed();
List<Tube> listTube = new ArrayList<Tube>();
System.out.println("Searching...");
try {
YouTubeQuery query = new YouTubeQuery(new URL(
"https://gdata.youtube.com/feeds/api/videos"));
query.setFullTextQuery(key);
query.setMaxResults(itemPerPage);
query.setStartIndex(itemPerPage * page);
query.setSafeSearch(YouTubeQuery.SafeSearch.NONE);
VideoFeed videoFeed = service.query(query, VideoFeed.class);
result.setTotalResult(videoFeed.getTotalResults());
result.setCurrentPage(page);
for (VideoEntry videoEntry : videoFeed.getEntries()) {
Tube tub = new Tube();