mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-13 22:00:32 +05:30
bda65e83d6
- Renaming and removal of duplicate code - New base class for list extractors
33 lines
920 B
Java
33 lines
920 B
Java
package org.schabi.newpipe.extractor;
|
|
|
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
|
import org.schabi.newpipe.extractor.stream.StreamInfoItemCollector;
|
|
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
* Base class to extractors that have a list (e.g. playlists, channels).
|
|
*/
|
|
public abstract class ListExtractor extends Extractor {
|
|
protected String nextStreamsUrl;
|
|
|
|
public ListExtractor(UrlIdHandler urlIdHandler, int serviceId, String url) {
|
|
super(urlIdHandler, serviceId, url);
|
|
}
|
|
|
|
public boolean hasMoreStreams(){
|
|
return nextStreamsUrl != null && !nextStreamsUrl.isEmpty();
|
|
}
|
|
|
|
public abstract StreamInfoItemCollector getNextStreams() throws ExtractionException, IOException;
|
|
|
|
public String getNextStreamsUrl() {
|
|
return nextStreamsUrl;
|
|
}
|
|
|
|
public void setNextStreamsUrl(String nextStreamsUrl) {
|
|
this.nextStreamsUrl = nextStreamsUrl;
|
|
}
|
|
|
|
}
|