所以我创建了一个类,它可以为我从一个频道获取视频列表。
public class YoutubeManager {
private static YoutubeManager instance;
private YouTube youTubeInstance;
private List<String> channelIDs;
private YoutubeManager() {}
public static YoutubeManager get() {
if(instance == null) {
instance = new YoutubeManager();
HttpTransport httpTransport = new ApacheHttpTransport();
HttpRequestInitializer httpRequestInitializer = new ClientParametersAuthentication("clientId", "clientSecret");
YouTube.Builder builder = new YouTube.Builder(httpTransport, new JacksonFactory(), httpRequestInitializer);
instance.youTubeInstance = builder.build();
}
return instance;
}
public List<Video> getVideos(String channelid) {
YouTube.Videos.List list = youTubeInstance.videos().list();
}
}
我现在不知道如何用youtubeapi制作视频列表。
那么最好的方法是什么呢?
暂无答案!
目前还没有任何答案,快来回答吧!