1
Java Youtube API를 사용하는 방법을 배우기 시작했지만 문제가 발생했습니다. 나는 구글에 의해 주어진 자습서를 다음입니다 :Youtube Java API. 로그인하지 않고 YouTubeService 만들기
문제가http://code.google.com/apis/youtube/2.0/developers_guide_java.html
, 당신이 쿼리를 만들기 위해 YouTubeService 객체를 필요로하는 것이다. 이 작업을 수행하는 유일한 방법은 로그인하는 사용자의 것입니다. 사용자가 로그인하지 않고 쿼리를 작성하려면 어떻게해야합니까?
YouTubeService service = new YouTubeService(); //???? How do I make a proper YouTubeService without login. There is no constructor without and parameters.
String search = "Dubstep";
try {
YouTubeQuery query = new YouTubeQuery(new URL("http://gdata.youtube.com/feeds/api/videos"));
query.setOrderBy(YouTubeQuery.OrderBy.RELEVANCE);
query.setFullTextQuery(search);
query.setSafeSearch(YouTubeQuery.SafeSearch.NONE);
VideoFeed videoFeed = service.query(query, VideoFeed.class);
printVideoFeed(videoFeed, true); // Eclipse also doesn't recognize this method.
} catch (MalformedURLException e) {
e.printStackTrace();
}
저는이 문제에 대해 정말로 혼란 스럽습니다.
감사합니다.