本文整理汇总了Java中org.schabi.newpipe.extractor.StreamingService类的典型用法代码示例。如果您正苦于以下问题:Java StreamingService类的具体用法?Java StreamingService怎么用?Java StreamingService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StreamingService类属于org.schabi.newpipe.extractor包,在下文中一共展示了StreamingService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的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();
}
}
示例2: getKioskList
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
@Override
public KioskList getKioskList()
throws ExtractionException {
KioskList list = new KioskList(getServiceId());
// add kiosks here e.g.:
try {
list.addKioskEntry(new KioskList.KioskExtractorFactory() {
@Override
public KioskExtractor createNewKiosk(StreamingService streamingService, String url, String nextStreamUrl, String id)
throws ExtractionException, IOException {
return new YoutubeTrendingExtractor(YoutubeService.this, url, nextStreamUrl, id);
}
}, new YoutubeTrendingUrlIdHandler(), "Trending");
list.setDefaultKiosk("Trending");
} catch (Exception e) {
throw new ExtractionException(e);
}
return list;
}
示例3: PlaylistExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public PlaylistExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
super(service, url, nextStreamsUrl);
}
示例4: getKioskList
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
@Override
public KioskList getKioskList() throws ExtractionException {
KioskList.KioskExtractorFactory chartsFactory = new KioskList.KioskExtractorFactory() {
@Override
public KioskExtractor createNewKiosk(StreamingService streamingService,
String url,
String nextStreamUrl,
String id)
throws ExtractionException, IOException {
return new SoundcloudChartsExtractor(SoundcloudService.this,
url,
nextStreamUrl,
id);
}
};
KioskList list = new KioskList(getServiceId());
// add kiosks here e.g.:
final SoundcloudChartsUrlIdHandler h = new SoundcloudChartsUrlIdHandler();
try {
list.addKioskEntry(chartsFactory, h, "Top 50");
list.addKioskEntry(chartsFactory, h, "New & hot");
} catch (Exception e) {
throw new ExtractionException(e);
}
return list;
}
示例5: KioskExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public KioskExtractor(StreamingService streamingService,
String url,
String nextStreamsUrl,
String kioskId)
throws IOException, ExtractionException {
super(streamingService, url, nextStreamsUrl);
this.id = kioskId;
}
示例6: setUp
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
@BeforeClass
public static void setUp()
throws Exception {
NewPipe.init(Downloader.getInstance());
StreamingService service = YouTube.getService();
UrlIdHandler urlIdHandler = service.getKioskList().getUrlIdHandlerByType("Trending");
kioskInfo = KioskInfo.getInfo(YouTube.getService(), urlIdHandler.getUrl("Trending"), null);
}
示例7: StreamExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public StreamExtractor(StreamingService service, String url) throws IOException, ExtractionException {
super(service, url);
}
示例8: getMoreItems
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public static NextItemsResult getMoreItems(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
return service.getChannelExtractor(url, nextStreamsUrl).getNextStreams();
}
示例9: getInfo
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public static ChannelInfo getInfo(StreamingService service, String url) throws IOException, ExtractionException {
ChannelExtractor extractor = service.getChannelExtractor(url);
extractor.fetchPage();
return getInfo(extractor);
}
示例10: ChannelExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public ChannelExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
super(service, url, nextStreamsUrl);
}
示例11: SoundcloudPlaylistExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public SoundcloudPlaylistExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
super(service, url, nextStreamsUrl);
}
示例12: SoundcloudChannelExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public SoundcloudChannelExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
super(service, url, nextStreamsUrl);
}
示例13: SoundcloudChartsExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public SoundcloudChartsExtractor(StreamingService service, String url, String nextStreamsUrl, String kioskId)
throws IOException, ExtractionException {
super(service, url, nextStreamsUrl, kioskId);
this.url = url;
}
示例14: YoutubeStreamExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public YoutubeStreamExtractor(StreamingService service, String url) throws IOException, ExtractionException {
super(service, url);
}
示例15: YoutubePlaylistExtractor
import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public YoutubePlaylistExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
super(service, url, nextStreamsUrl);
}