Class LinkHandlerFactory
java.lang.Object
org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory
- Direct Known Subclasses:
BandcampStreamLinkHandlerFactory,ListLinkHandlerFactory,MediaCCCStreamLinkHandlerFactory,PeertubeStreamLinkHandlerFactory,SoundcloudStreamLinkHandlerFactory,YoutubeStreamLinkHandlerFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhen 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.Builds aLinkHandlerfrom a url.
Be sure to callUtils.followGoogleRedirectIfNeeded(String)on the url if overriding this function.Builds aLinkHandlerfrom an URL and a base URL.abstract Stringabstract Stringabstract booleanonAcceptUrl(String url)
-
Constructor Details
-
LinkHandlerFactory
public LinkHandlerFactory()
-
-
Method Details
-
getId
-
getUrl
-
onAcceptUrl
- Throws:
ParsingException
-
getUrl
public String getUrl(String id, String baseUrl) throws ParsingException, UnsupportedOperationException -
fromUrl
Builds aLinkHandlerfrom 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
LinkHandlercomplete with information - Throws:
ParsingException
-
fromUrl
Builds aLinkHandlerfrom an URL and a base URL. The URL is expected to be already polished from Google search redirects (otherwise how couldbaseUrlhave 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
LinkHandlercomplete with information - Throws:
ParsingException
-
fromId
- Throws:
ParsingException
-
fromId
- Throws:
ParsingException
-
acceptUrl
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
-