Class LinkHandlerFactory
- java.lang.Object
-
- org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory
-
- Direct Known Subclasses:
BandcampStreamLinkHandlerFactory
,ListLinkHandlerFactory
,MediaCCCStreamLinkHandlerFactory
,PeertubeStreamLinkHandlerFactory
,SoundcloudStreamLinkHandlerFactory
,YoutubeStreamLinkHandlerFactory
public abstract class LinkHandlerFactory extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description LinkHandlerFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
acceptUrl(java.lang.String url)
When a VIEW_ACTION is caught this function will test if the url delivered within the calling Intent was meant to be watched with this Service.LinkHandler
fromId(java.lang.String id)
LinkHandler
fromId(java.lang.String id, java.lang.String baseUrl)
LinkHandler
fromUrl(java.lang.String url)
Builds aLinkHandler
from a url.
Be sure to callUtils.followGoogleRedirectIfNeeded(String)
on the url if overriding this function.LinkHandler
fromUrl(java.lang.String url, java.lang.String baseUrl)
Builds aLinkHandler
from an URL and a base URL.abstract java.lang.String
getId(java.lang.String url)
abstract java.lang.String
getUrl(java.lang.String id)
java.lang.String
getUrl(java.lang.String id, java.lang.String baseUrl)
abstract boolean
onAcceptUrl(java.lang.String url)
-
-
-
Method Detail
-
getId
public abstract java.lang.String getId(java.lang.String url) throws ParsingException, java.lang.UnsupportedOperationException
- Throws:
ParsingException
java.lang.UnsupportedOperationException
-
getUrl
public abstract java.lang.String getUrl(java.lang.String id) throws ParsingException, java.lang.UnsupportedOperationException
- Throws:
ParsingException
java.lang.UnsupportedOperationException
-
onAcceptUrl
public abstract boolean onAcceptUrl(java.lang.String url) throws ParsingException
- Throws:
ParsingException
-
getUrl
public java.lang.String getUrl(java.lang.String id, java.lang.String baseUrl) throws ParsingException, java.lang.UnsupportedOperationException
- Throws:
ParsingException
java.lang.UnsupportedOperationException
-
fromUrl
public LinkHandler fromUrl(java.lang.String url) throws ParsingException
Builds aLinkHandler
from a url.
Be sure to callUtils.followGoogleRedirectIfNeeded(String)
on the url if overriding this function.- Parameters:
url
- the url to extract path and id from- Returns:
- a
LinkHandler
complete with information - Throws:
ParsingException
-
fromUrl
public LinkHandler fromUrl(java.lang.String url, java.lang.String baseUrl) throws ParsingException
Builds aLinkHandler
from an URL and a base URL. The URL is expected to be already polished from Google search redirects (otherwise how couldbaseUrl
have been extracted?).
So do not callUtils.followGoogleRedirectIfNeeded(String)
on the URL if overriding this function, since that should be done infromUrl(String)
.- Parameters:
url
- the URL without Google search redirects to extract id frombaseUrl
- the base URL- Returns:
- a
LinkHandler
complete with information - Throws:
ParsingException
-
fromId
public LinkHandler fromId(java.lang.String id) throws ParsingException
- Throws:
ParsingException
-
fromId
public LinkHandler fromId(java.lang.String id, java.lang.String baseUrl) throws ParsingException
- Throws:
ParsingException
-
acceptUrl
public boolean acceptUrl(java.lang.String url) throws ParsingException
When a VIEW_ACTION is caught this function will test if the url delivered within the calling Intent was meant to be watched with this Service. Return false if this service shall not allow to be called through ACTIONs.- Throws:
ParsingException
-
-