Class SubscriptionExtractor
- java.lang.Object
-
- org.schabi.newpipe.extractor.subscription.SubscriptionExtractor
-
- Direct Known Subclasses:
SoundcloudSubscriptionExtractor,YoutubeSubscriptionExtractor
public abstract class SubscriptionExtractor extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSubscriptionExtractor.ContentSourcestatic classSubscriptionExtractor.InvalidSourceExceptionException that should be thrown when the input do not contain valid content that the extractor can parse (e.g.
-
Field Summary
Fields Modifier and Type Field Description protected StreamingServiceservice
-
Constructor Summary
Constructors Constructor Description SubscriptionExtractor(StreamingService service, java.util.List<SubscriptionExtractor.ContentSource> supportedSources)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<SubscriptionItem>fromChannelUrl(java.lang.String channelUrl)Reads and parse a list ofSubscriptionItemfrom the given channel url.java.util.List<SubscriptionItem>fromInputStream(java.io.InputStream contentInputStream)Reads and parse a list ofSubscriptionItemfrom the given InputStream.java.util.List<SubscriptionItem>fromInputStream(java.io.InputStream contentInputStream, java.lang.String contentType)Reads and parse a list ofSubscriptionItemfrom the given InputStream.abstract java.lang.StringgetRelatedUrl()Returns an url that can help/guide the user to the file (or channel url) to extract the subscriptions.java.util.List<SubscriptionExtractor.ContentSource>getSupportedSources()
-
-
-
Field Detail
-
service
protected final StreamingService service
-
-
Constructor Detail
-
SubscriptionExtractor
public SubscriptionExtractor(StreamingService service, java.util.List<SubscriptionExtractor.ContentSource> supportedSources)
-
-
Method Detail
-
getSupportedSources
public java.util.List<SubscriptionExtractor.ContentSource> getSupportedSources()
-
getRelatedUrl
@Nullable public abstract java.lang.String getRelatedUrl()
Returns an url that can help/guide the user to the file (or channel url) to extract the subscriptions.For example, in YouTube, the export subscriptions url is a good choice to return here.
-
fromChannelUrl
public java.util.List<SubscriptionItem> fromChannelUrl(java.lang.String channelUrl) throws java.io.IOException, ExtractionException
Reads and parse a list ofSubscriptionItemfrom the given channel url.- Throws:
SubscriptionExtractor.InvalidSourceException- when the channelUrl doesn't exist or is invalidjava.io.IOExceptionExtractionException
-
fromInputStream
public java.util.List<SubscriptionItem> fromInputStream(@Nonnull java.io.InputStream contentInputStream) throws ExtractionException
Reads and parse a list ofSubscriptionItemfrom the given InputStream.- Throws:
SubscriptionExtractor.InvalidSourceException- when the content read from the InputStream is invalid and can not be parsedExtractionException
-
fromInputStream
public java.util.List<SubscriptionItem> fromInputStream(@Nonnull java.io.InputStream contentInputStream, @Nonnull java.lang.String contentType) throws ExtractionException
Reads and parse a list ofSubscriptionItemfrom the given InputStream.- Throws:
SubscriptionExtractor.InvalidSourceException- when the content read from the InputStream is invalid and can not be parsedExtractionException
-
-