当前位置: 首页>>代码示例>>Java>>正文


Java StreamingService类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:TeamNewPipe,项目名称:np-cli,代码行数:38,代码来源:GetStreamUrl.java

示例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;
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:22,代码来源:YoutubeService.java

示例3: PlaylistExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public PlaylistExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
    super(service, url, nextStreamsUrl);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:PlaylistExtractor.java

示例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;
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:30,代码来源:SoundcloudService.java

示例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;
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:9,代码来源:KioskExtractor.java

示例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);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:10,代码来源:YoutubeTreindingKioskInfoTest.java

示例7: StreamExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public StreamExtractor(StreamingService service, String url) throws IOException, ExtractionException {
    super(service, url);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:StreamExtractor.java

示例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();
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:ChannelInfo.java

示例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);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:6,代码来源:ChannelInfo.java

示例10: ChannelExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public ChannelExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
    super(service, url, nextStreamsUrl);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:ChannelExtractor.java

示例11: SoundcloudPlaylistExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public SoundcloudPlaylistExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
    super(service, url, nextStreamsUrl);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:SoundcloudPlaylistExtractor.java

示例12: SoundcloudChannelExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public SoundcloudChannelExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
    super(service, url, nextStreamsUrl);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:SoundcloudChannelExtractor.java

示例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;
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:6,代码来源:SoundcloudChartsExtractor.java

示例14: YoutubeStreamExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public YoutubeStreamExtractor(StreamingService service, String url) throws IOException, ExtractionException {
    super(service, url);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:YoutubeStreamExtractor.java

示例15: YoutubePlaylistExtractor

import org.schabi.newpipe.extractor.StreamingService; //导入依赖的package包/类
public YoutubePlaylistExtractor(StreamingService service, String url, String nextStreamsUrl) throws IOException, ExtractionException {
    super(service, url, nextStreamsUrl);
}
 
开发者ID:TeamNewPipe,项目名称:NewPipeExtractor,代码行数:4,代码来源:YoutubePlaylistExtractor.java


注:本文中的org.schabi.newpipe.extractor.StreamingService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。