|
| 1 | +package org.schabi.newpipe.extractor.playlist; |
| 2 | + |
| 3 | +import org.schabi.newpipe.extractor.UrlIdHandler; |
| 4 | +import org.schabi.newpipe.extractor.exceptions.ExtractionException; |
| 5 | +import org.schabi.newpipe.extractor.exceptions.ParsingException; |
| 6 | +import org.schabi.newpipe.extractor.stream_info.StreamInfoItemCollector; |
| 7 | + |
| 8 | +import java.io.IOException; |
| 9 | + |
| 10 | +public abstract class PlayListExtractor { |
| 11 | + |
| 12 | + private int serviceId; |
| 13 | + private String url; |
| 14 | + private UrlIdHandler urlIdHandler; |
| 15 | + private StreamInfoItemCollector previewInfoCollector; |
| 16 | + private int page = -1; |
| 17 | + |
| 18 | + public PlayListExtractor(UrlIdHandler urlIdHandler, String url, int page, int serviceId) |
| 19 | + throws ExtractionException, IOException { |
| 20 | + this.url = url; |
| 21 | + this.page = page; |
| 22 | + this.serviceId = serviceId; |
| 23 | + this.urlIdHandler = urlIdHandler; |
| 24 | + previewInfoCollector = new StreamInfoItemCollector(urlIdHandler, serviceId); |
| 25 | + } |
| 26 | + |
| 27 | + public String getUrl() { return url; } |
| 28 | + public UrlIdHandler getUrlIdHandler() { return urlIdHandler; } |
| 29 | + public StreamInfoItemCollector getStreamPreviewInfoCollector() { |
| 30 | + return previewInfoCollector; |
| 31 | + } |
| 32 | + |
| 33 | + public abstract String getName() throws ParsingException; |
| 34 | + public abstract String getAvatarUrl() throws ParsingException; |
| 35 | + public abstract String getBannerUrl() throws ParsingException; |
| 36 | + public abstract StreamInfoItemCollector getStreams() throws ParsingException; |
| 37 | + public abstract boolean hasNextPage() throws ParsingException; |
| 38 | + public int getServiceId() { |
| 39 | + return serviceId; |
| 40 | + } |
| 41 | +} |
0 commit comments