org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeChannelLinkHandlerFactory类的使用及代码示例

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

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

YoutubeChannelLinkHandlerFactory介绍

暂无

代码示例

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

@Override
public ListLinkHandlerFactory getChannelLHFactory() {
  return YoutubeChannelLinkHandlerFactory.getInstance();
}

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

@Override
  public boolean onAcceptUrl(String url) {
    try {
      getId(url);
    } catch (ParsingException e) {
      return false;
    }
    return true;
  }
}

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

@Test
public void acceptrUrlTest() throws ParsingException {
  assertTrue(linkHandler.acceptUrl("https://www.youtube.com/user/Gronkh"));
  assertTrue(linkHandler.acceptUrl("https://www.youtube.com/user/Netzkino/videos"));
  assertTrue(linkHandler.acceptUrl("https://www.youtube.com/channel/UClq42foiSgl7sSpLupnugGA"));
  assertTrue(linkHandler.acceptUrl("https://www.youtube.com/channel/UClq42foiSgl7sSpLupnugGA/videos?disable_polymer=1"));
  assertTrue(linkHandler.acceptUrl("https://hooktube.com/user/Gronkh"));
  assertTrue(linkHandler.acceptUrl("https://hooktube.com/user/Netzkino/videos"));
  assertTrue(linkHandler.acceptUrl("https://hooktube.com/channel/UClq42foiSgl7sSpLupnugGA"));
  assertTrue(linkHandler.acceptUrl("https://hooktube.com/channel/UClq42foiSgl7sSpLupnugGA/videos?disable_polymer=1"));
}

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

@Test
  public void getIdFromUrl() throws ParsingException {
    assertEquals("user/Gronkh", linkHandler.fromUrl("https://www.youtube.com/user/Gronkh").getId());
    assertEquals("user/Netzkino", linkHandler.fromUrl("https://www.youtube.com/user/Netzkino/videos").getId());

    assertEquals("channel/UClq42foiSgl7sSpLupnugGA", linkHandler.fromUrl("https://www.youtube.com/channel/UClq42foiSgl7sSpLupnugGA").getId());
    assertEquals("channel/UClq42foiSgl7sSpLupnugGA", linkHandler.fromUrl("https://www.youtube.com/channel/UClq42foiSgl7sSpLupnugGA/videos?disable_polymer=1").getId());

    assertEquals("user/Gronkh", linkHandler.fromUrl("https://hooktube.com/user/Gronkh").getId());
    assertEquals("user/Netzkino", linkHandler.fromUrl("https://hooktube.com/user/Netzkino/videos").getId());

    assertEquals("channel/UClq42foiSgl7sSpLupnugGA", linkHandler.fromUrl("https://hooktube.com/channel/UClq42foiSgl7sSpLupnugGA").getId());
    assertEquals("channel/UClq42foiSgl7sSpLupnugGA", linkHandler.fromUrl("https://hooktube.com/channel/UClq42foiSgl7sSpLupnugGA/videos?disable_polymer=1").getId());
  }
}

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

@BeforeClass
public static void setUp() {
  linkHandler = YoutubeChannelLinkHandlerFactory.getInstance();
  NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
}

相关文章

YoutubeChannelLinkHandlerFactory类方法