org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeChannelExtractor.fetchPage()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(120)

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

YoutubeChannelExtractor.fetchPage介绍

暂无

代码示例

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

@Override
public InfoItemsPage<StreamInfoItem> getPage(String pageUrl) throws IOException, ExtractionException {
  if (pageUrl == null || pageUrl.isEmpty()) {
    throw new ExtractionException(new IllegalArgumentException("Page url is empty or null"));
  }
  // Unfortunately, we have to fetch the page even if we are only getting next streams,
  // as they don't deliver enough information on their own (the channel name, for example).
  fetchPage();
  StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
  JsonObject ajaxJson;
  try {
    ajaxJson = JsonParser.object().from(NewPipe.getDownloader().download(pageUrl));
  } catch (JsonParserException pe) {
    throw new ParsingException("Could not parse json data for next streams", pe);
  }
  final Document ajaxHtml = Jsoup.parse(ajaxJson.getString("content_html"), pageUrl);
  collectStreamsFrom(collector, ajaxHtml.select("body").first());
  return new InfoItemsPage<>(collector, getNextPageUrlFromAjaxPage(ajaxJson, pageUrl));
}

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

@BeforeClass
public static void setUp() throws Exception {
  NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
  extractor = (YoutubeChannelExtractor) YouTube
      .getChannelExtractor("https://www.youtube.com/user/Vsauce");
  extractor.fetchPage();
}

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

@BeforeClass
public static void setUp() throws Exception {
  NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
  extractor = (YoutubeChannelExtractor) YouTube
      .getChannelExtractor("http://www.youtube.com/user/Gronkh");
  extractor.fetchPage();
}

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

@BeforeClass
public static void setUp() throws Exception {
  NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
  extractor = (YoutubeChannelExtractor) YouTube
      .getChannelExtractor("https://www.youtube.com/channel/UCUaQMQS9lY5lit3vurpXQ6w");
  extractor.fetchPage();
}

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

@BeforeClass
public static void setUp() throws Exception {
  NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
  extractor = (YoutubeChannelExtractor) YouTube
      .getChannelExtractor("https://www.youtube.com/user/CaptainDisillusion/videos");
  extractor.fetchPage();
}

代码示例来源:origin: TeamNewPipe/NewPipeExtractor

@BeforeClass
public static void setUp() throws Exception {
  NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
  extractor = (YoutubeChannelExtractor) YouTube
      .getChannelExtractor("https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q");
  extractor.fetchPage();
}

相关文章