base
Episode = Union[int, float]
module-attribute
¶
Episode type, float or integer.
BaseProvider(base_url_override=None)
¶
Bases: ABC
This is the abstract base class for all the providers, use this as documentation to know how to use the providers.
To get a list of Providers use the list_providers function or use get_provider to get a provider by name.
Attributes:
Name | Type | Description |
---|---|---|
NAME |
str
|
The name of the provider |
BASE_URL |
str
|
The base url of the provider |
FILTER_CAPS |
FilterCapabilities
|
The filter capabilities of the provider |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url_override
|
Optional[str]
|
Override the url used by the provider. |
None
|
Source code in api/src/anipy_api/provider/base.py
get_episodes(identifier, lang)
abstractmethod
¶
Get a list of episodes of an anime.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
The identifier of the anime |
required |
lang
|
LanguageTypeEnum
|
The language type used to look up the episode list |
required |
Returns:
Type | Description |
---|---|
List[Episode]
|
A list of episodes |
Raises:
Type | Description |
---|---|
LangTypeNotAvailableError
|
Raised when the language provided is not available for the anime |
Source code in api/src/anipy_api/provider/base.py
get_info(identifier)
abstractmethod
¶
Get detailed information about an anime.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
The identifier of the anime |
required |
Returns:
Type | Description |
---|---|
ProviderInfoResult
|
A information object |
get_search(query, filters=Filters())
abstractmethod
¶
Search in the Provider.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
str
|
The search query |
required |
filters
|
Filters
|
The filter object, check FILTER_CAPS to see which filters this provider supports |
Filters()
|
Returns:
Type | Description |
---|---|
List[ProviderSearchResult]
|
A list of search results |
Source code in api/src/anipy_api/provider/base.py
get_video(identifier, episode, lang)
abstractmethod
¶
Get a list of video streams for a anime episode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identifier
|
str
|
The identifier of the anime |
required |
episode
|
Episode
|
The episode to get the streams from |
required |
lang
|
LanguageTypeEnum
|
The language type used to look up the streams |
required |
Returns:
Type | Description |
---|---|
List[ProviderStream]
|
A list of video streams |
Raises:
Type | Description |
---|---|
LangTypeNotAvailableError
|
Raised when the language provided is not available for the anime |
Source code in api/src/anipy_api/provider/base.py
LanguageTypeEnum
¶
Bases: Enum
A enum that contains possible language types of anime.
Attributes:
Name | Type | Description |
---|---|---|
SUB |
|
|
DUB |
|
ProviderInfoResult(name=None, image=None, genres=None, synopsis=None, release_year=None, status=None, alternative_names=None)
dataclass
¶
A class that contains detailed information about an anime.
Attributes:
Name | Type | Description |
---|---|---|
name |
Optional[str]
|
Name of the Anime |
image |
Optional[str]
|
Image of the Anime |
genres |
Optional[List[str]]
|
Genres of the Anime |
synopsis |
Optional[str]
|
Synopsis of the Anime |
release_year |
Optional[int]
|
Release year of the Anime |
status |
Optional[Status]
|
Status of the anime |
alternative_names |
Optional[List[str]]
|
List of alternative names |
ProviderSearchResult(identifier, name, languages)
dataclass
¶
A class that contains information about a search result.
Attributes:
Name | Type | Description |
---|---|---|
identifier |
str
|
The identifier of the anime |
name |
str
|
The name of the anime |
languages |
Set[LanguageTypeEnum]
|
A set of supported language types for that anime |
ProviderStream(url, resolution, episode, language, referrer=None)
dataclass
¶
A class that contains information about a video stream.
Attributes:
Name | Type | Description |
---|---|---|
url |
str
|
The url of the stream. |
resolution |
int
|
The resolution (actually the width) of the stream. (e.g. 1080, 720 etc.) |
episode |
Episode
|
The episode this stream is from |
language |
LanguageTypeEnum
|
The language type this stream is in |
referrer |
Optional[str]
|
Referrer to be set when downloading/viewing if necassary. |