本文整理汇总了Java中org.schabi.newpipe.extractor.stream.StreamExtractor类的典型用法代码示例。如果您正苦于以下问题:Java StreamExtractor类的具体用法?Java StreamExtractor怎么用?Java StreamExtractor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StreamExtractor类属于org.schabi.newpipe.extractor.stream包,在下文中一共展示了StreamExtractor类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
public static void main(String argv[]) {
if(argv.length == 0) {
System.err.println("please provide a youtube url as first parameter.");
return;
}
String url = argv[0];
//first we need to set the Downloader, so NewPipe knows how to get the files
NewPipe.init(initDownloader());
try {
StreamingService youtube = NewPipe.getService("Youtube");
StreamExtractor extractor = youtube.getStreamExtractorInstance(url);
// actual extraction
StreamInfo streamInfo = StreamInfo.getVideoInfo(extractor);
// if non critical exceptions happened during extraction they will be printed now
for(Throwable error : streamInfo.errors) {
System.err.println("----------------");
error.printStackTrace();
}
// now print the stream url and we are done
for(VideoStream stream : streamInfo.video_streams) {
if(stream.resolution.contains("320p") ||
stream.resolution.contains("720p") ||
stream.resolution.contains("360p")) {
System.out.print(stream.url);
return;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:TeamNewPipe,项目名称:np-cli,代码行数:38,代码来源:GetStreamUrl.java
示例2: getRelatedVideosOrLogError
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
public static List<InfoItem> getRelatedVideosOrLogError(StreamInfo info, StreamExtractor extractor) {
StreamInfoItemCollector collector;
try {
collector = extractor.getRelatedVideos();
} catch (Exception e) {
info.addError(e);
return Collections.emptyList();
}
// Get from collector
return getInfoItems(info, collector);
}
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:12,代码来源:ExtractorHelper.java
示例3: getStreamExtractor
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
@Override
public StreamExtractor getStreamExtractor(String url) throws IOException, ExtractionException {
return new SoundcloudStreamExtractor(this, url);
}
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:5,代码来源:SoundcloudService.java
示例4: getStreamExtractor
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
@Override
public StreamExtractor getStreamExtractor(String url) throws IOException, ExtractionException {
return new YoutubeStreamExtractor(this, url);
}
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:5,代码来源:YoutubeService.java
示例5: testGetValidTimeStamp
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
@Test
public void testGetValidTimeStamp() throws IOException, ExtractionException {
StreamExtractor extractor = SoundCloud.getService().getStreamExtractor("https://soundcloud.com/liluzivert/do-what-i-want-produced-by-maaly-raw-don-cannon#t=69");
assertEquals(extractor.getTimeStamp() + "", "69");
}
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:6,代码来源:SoundcloudStreamExtractorDefaultTest.java
示例6: testGetValidTimeStamp
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
@Test
public void testGetValidTimeStamp() throws IOException, ExtractionException {
StreamExtractor extractor = YouTube.getService().getStreamExtractor("https://youtu.be/FmG385_uUys?t=174");
assertEquals(extractor.getTimeStamp() + "", "174");
}
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:6,代码来源:YoutubeStreamExtractorRestrictedTest.java
示例7: getStreamExtractor
import org.schabi.newpipe.extractor.stream.StreamExtractor; //导入依赖的package包/类
public abstract StreamExtractor getStreamExtractor(String url) throws IOException, ExtractionException;
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:2,代码来源:StreamingService.java
注:本文中的org.schabi.newpipe.extractor.stream.StreamExtractor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论