Package org.schabi.newpipe.extractor
Class ListExtractor<R extends InfoItem>
- java.lang.Object
-
- org.schabi.newpipe.extractor.Extractor
-
- org.schabi.newpipe.extractor.ListExtractor<R>
-
- Type Parameters:
R
- the info item type this list extractor provides
- Direct Known Subclasses:
ChannelTabExtractor
,CommentsExtractor
,FeedExtractor
,KioskExtractor
,PlaylistExtractor
,SearchExtractor
public abstract class ListExtractor<R extends InfoItem> extends Extractor
Base class to extractors that have a list (e.g. playlists, users).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ListExtractor.InfoItemsPage<T extends InfoItem>
A class that is used to wrap a list of gathered items and eventual errors, it also contains a field that points to the next available page (ListExtractor.InfoItemsPage.nextPage
).
-
Field Summary
Fields Modifier and Type Field Description static long
ITEM_COUNT_INFINITE
Constant that should be returned whenever a list has an infinite number of items.static long
ITEM_COUNT_MORE_THAN_100
Constant that should be returned whenever a list has an unknown number of items bigger than 100.static long
ITEM_COUNT_UNKNOWN
Constant that should be returned whenever a list has an unknown number of items.
-
Constructor Summary
Constructors Constructor Description ListExtractor(StreamingService service, ListLinkHandler linkHandler)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ListExtractor.InfoItemsPage<R>
getInitialPage()
AInfoItemsPage
corresponding to the initial page where the items are from the initial request and the nextPage relative to it.ListLinkHandler
getLinkHandler()
abstract ListExtractor.InfoItemsPage<R>
getPage(Page page)
Get a list of items corresponding to the specific requested page.-
Methods inherited from class org.schabi.newpipe.extractor.Extractor
assertPageFetched, fetchPage, forceContentCountry, forceLocalization, getBaseUrl, getDownloader, getExtractorContentCountry, getExtractorLocalization, getId, getName, getOriginalUrl, getService, getServiceId, getTimeAgoParser, getUrl, isPageFetched, onFetchPage
-
-
-
-
Field Detail
-
ITEM_COUNT_UNKNOWN
public static final long ITEM_COUNT_UNKNOWN
Constant that should be returned whenever a list has an unknown number of items.- See Also:
- Constant Field Values
-
ITEM_COUNT_INFINITE
public static final long ITEM_COUNT_INFINITE
Constant that should be returned whenever a list has an infinite number of items. For example a YouTube mix.- See Also:
- Constant Field Values
-
ITEM_COUNT_MORE_THAN_100
public static final long ITEM_COUNT_MORE_THAN_100
Constant that should be returned whenever a list has an unknown number of items bigger than 100.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ListExtractor
public ListExtractor(StreamingService service, ListLinkHandler linkHandler)
-
-
Method Detail
-
getInitialPage
@Nonnull public abstract ListExtractor.InfoItemsPage<R> getInitialPage() throws java.io.IOException, ExtractionException
AInfoItemsPage
corresponding to the initial page where the items are from the initial request and the nextPage relative to it.- Returns:
- a
ListExtractor.InfoItemsPage
corresponding to the initial page - Throws:
java.io.IOException
ExtractionException
-
getPage
public abstract ListExtractor.InfoItemsPage<R> getPage(Page page) throws java.io.IOException, ExtractionException
Get a list of items corresponding to the specific requested page.- Parameters:
page
- any page got from the exclusive implementation of the list extractor- Returns:
- a
ListExtractor.InfoItemsPage
corresponding to the requested page - Throws:
java.io.IOException
ExtractionException
- See Also:
ListExtractor.InfoItemsPage.getNextPage()
-
getLinkHandler
@Nonnull public ListLinkHandler getLinkHandler()
- Overrides:
getLinkHandler
in classExtractor
- Returns:
- The
LinkHandler
of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
-
-