gpt4 book ai didi

com.google.api.services.youtube.YouTube.search()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 10:28:49 26 4
gpt4 key购买 nike

本文整理了Java中com.google.api.services.youtube.YouTube.search()方法的一些代码示例,展示了YouTube.search()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YouTube.search()方法的具体详情如下:
包路径:com.google.api.services.youtube.YouTube
类名称:YouTube
方法名:search

YouTube.search介绍

[英]An accessor for creating requests from the Search collection.

The typical use is:

YouTube youtube = new YouTube(...); YouTube.Search.List request = youtube.search().list(parameters ...)

[中]用于从搜索集合创建请求的访问器。
典型用途是:

YouTube youtube = new YouTube(...); YouTube.Search.List request = youtube.search().list(parameters ...)

代码示例

代码示例来源:origin: Kaaz/DiscordBot

public YTSearch() {
  keyQueue = new LinkedList<>();
  Collections.addAll(keyQueue, BotConfig.GOOGLE_API_KEY);
  youtube = new YouTube.Builder(new NetHttpTransport(), new JacksonFactory(), (HttpRequest request) -> {
  }).setApplicationName(BotConfig.BOT_NAME).build();
  YouTube.Search.List tmp = null;
  try {
    tmp = youtube.search().list("id,snippet");
    tmp.setOrder("relevance");
    tmp.setVideoCategoryId("10");
  } catch (IOException ex) {
    DiscordBot.LOGGER.error("Failed to initialize search: " + ex.toString());
  }
  search = tmp;
  if (search != null) {
    search.setType("video");
    search.setFields("items(id/kind,id/videoId,snippet/title)");
  }
  setupNextKey();
}

代码示例来源:origin: spheras/messic

YouTube.Search.List search = youtube.search().list( "id,snippet" );

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com