public abstract class StreamingService extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StreamingService.LinkType
LinkType will be used to determine which type of URL you are handling, and therefore which part
of NewPipe should handle a certain URL.
|
static class |
StreamingService.ServiceInfo
This class holds meta information about the service implementation.
|
Constructor and Description |
---|
StreamingService(int id,
String name,
List<StreamingService.ServiceInfo.MediaCapability> capabilities)
Creates a new Streaming service.
|
Modifier and Type | Method and Description |
---|---|
abstract String |
getBaseUrl() |
abstract ChannelExtractor |
getChannelExtractor(ListLinkHandler linkHandler)
Must create a new instance of a ChannelExtractor implementation.
|
ChannelExtractor |
getChannelExtractor(String url) |
ChannelExtractor |
getChannelExtractor(String id,
List<String> contentFilter,
String sortFilter) |
abstract ListLinkHandlerFactory |
getChannelLHFactory()
Must return a new instance of an implementation of ListLinkHandlerFactory for channels.
|
abstract CommentsExtractor |
getCommentsExtractor(ListLinkHandler linkHandler) |
CommentsExtractor |
getCommentsExtractor(String url) |
abstract ListLinkHandlerFactory |
getCommentsLHFactory() |
ContentCountry |
getContentCountry()
Returns the country that should be used to fetch content in this service.
|
FeedExtractor |
getFeedExtractor(String url)
This method decides which strategy will be chosen to fetch the feed.
|
abstract KioskList |
getKioskList()
Must create a new instance of a KioskList implementation.
|
StreamingService.LinkType |
getLinkTypeByUrl(String url)
Figures out where the link is pointing to (a channel, a video, a playlist, etc.)
|
Localization |
getLocalization()
Returns the localization that should be used in this service.
|
abstract PlaylistExtractor |
getPlaylistExtractor(ListLinkHandler linkHandler)
Must crete a new instance of a PlaylistExtractor implementation.
|
PlaylistExtractor |
getPlaylistExtractor(String url) |
PlaylistExtractor |
getPlaylistExtractor(String id,
List<String> contentFilter,
String sortFilter) |
abstract ListLinkHandlerFactory |
getPlaylistLHFactory()
Must return a new instance of an implementation of ListLinkHandlerFactory for playlists.
|
abstract SearchExtractor |
getSearchExtractor(SearchQueryHandler queryHandler)
Must create a new instance of a SearchExtractor implementation.
|
SearchExtractor |
getSearchExtractor(String query) |
SearchExtractor |
getSearchExtractor(String query,
List<String> contentFilter,
String sortFilter) |
abstract SearchQueryHandlerFactory |
getSearchQHFactory()
Must return an instance of an implementation of SearchQueryHandlerFactory.
|
int |
getServiceId() |
StreamingService.ServiceInfo |
getServiceInfo() |
abstract StreamExtractor |
getStreamExtractor(LinkHandler linkHandler)
Must create a new instance of a StreamExtractor implementation.
|
StreamExtractor |
getStreamExtractor(String url) |
abstract LinkHandlerFactory |
getStreamLHFactory()
Must return a new instance of an implementation of LinkHandlerFactory for streams.
|
abstract SubscriptionExtractor |
getSubscriptionExtractor()
Outdated or obsolete.
|
abstract SuggestionExtractor |
getSuggestionExtractor()
Must create a new instance of a SuggestionExtractor implementation.
|
List<ContentCountry> |
getSupportedCountries()
Returns a list of countries that this service supports.
|
List<Localization> |
getSupportedLocalizations()
Returns a list of localizations that this service supports.
|
TimeAgoParser |
getTimeAgoParser(Localization localization)
Get an instance of the time ago parser using the patterns related to the passed localization.
Just like getLocalization() , it will also try to fallback to a less specific localization if
the exact one is not available/supported. |
String |
toString() |
public StreamingService(int id, String name, List<StreamingService.ServiceInfo.MediaCapability> capabilities)
id
- the number of the service to identify him within the NewPipe frontendname
- the name of the servicecapabilities
- the type of media this service can handlepublic final int getServiceId()
public StreamingService.ServiceInfo getServiceInfo()
public abstract String getBaseUrl()
public abstract LinkHandlerFactory getStreamLHFactory()
public abstract ListLinkHandlerFactory getChannelLHFactory()
public abstract ListLinkHandlerFactory getPlaylistLHFactory()
public abstract SearchQueryHandlerFactory getSearchQHFactory()
public abstract ListLinkHandlerFactory getCommentsLHFactory()
public abstract SearchExtractor getSearchExtractor(SearchQueryHandler queryHandler)
queryHandler
- specifies the keyword lock for, and the filters which should be applied.public abstract SuggestionExtractor getSuggestionExtractor()
public abstract SubscriptionExtractor getSubscriptionExtractor()
@Nullable public FeedExtractor getFeedExtractor(String url) throws ExtractionException
In services which there's no other way to retrieve them, null should be returned.
FeedExtractor
instance or null.ExtractionException
public abstract KioskList getKioskList() throws ExtractionException
ExtractionException
public abstract ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler) throws ExtractionException
linkHandler
- is pointing to the channel which should be handled by this new instance.ExtractionException
public abstract PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandler) throws ExtractionException
linkHandler
- is pointing to the playlist which should be handled by this new instance.ExtractionException
public abstract StreamExtractor getStreamExtractor(LinkHandler linkHandler) throws ExtractionException
linkHandler
- is pointing to the stream which should be handled by this new instance.ExtractionException
public abstract CommentsExtractor getCommentsExtractor(ListLinkHandler linkHandler) throws ExtractionException
ExtractionException
public SearchExtractor getSearchExtractor(String query, List<String> contentFilter, String sortFilter) throws ExtractionException
ExtractionException
public ChannelExtractor getChannelExtractor(String id, List<String> contentFilter, String sortFilter) throws ExtractionException
ExtractionException
public PlaylistExtractor getPlaylistExtractor(String id, List<String> contentFilter, String sortFilter) throws ExtractionException
ExtractionException
public SearchExtractor getSearchExtractor(String query) throws ExtractionException
ExtractionException
public ChannelExtractor getChannelExtractor(String url) throws ExtractionException
ExtractionException
public PlaylistExtractor getPlaylistExtractor(String url) throws ExtractionException
ExtractionException
public StreamExtractor getStreamExtractor(String url) throws ExtractionException
ExtractionException
public CommentsExtractor getCommentsExtractor(String url) throws ExtractionException
ExtractionException
public final StreamingService.LinkType getLinkTypeByUrl(String url) throws ParsingException
url
- the url on which it should be decided of which link type it isParsingException
public List<Localization> getSupportedLocalizations()
public List<ContentCountry> getSupportedCountries()
public Localization getLocalization()
NewPipe.getPreferredLocalization()
), then it will:
default
localization.public ContentCountry getContentCountry()
NewPipe.getPreferredContentCountry()
), then it will:
default
country.public TimeAgoParser getTimeAgoParser(Localization localization)
getLocalization()
, it will also try to fallback to a less specific localization if
the exact one is not available/supported.IllegalArgumentException
- if the localization is not supported (parsing patterns are not present).