Models¶
-
class
SourceAnime
(*args, **kwargs)[source]¶ Bases:
grobber.anime.models.anime.Anime
,grobber.stateful.Expiring
,abc.ABC
-
ATTRS
= ('media_id', 'is_dub', 'language', 'title', 'thumbnail', 'episode_count', 'episodes', 'last_update')¶
-
CHANGING_ATTRS
= ('episode_count',)¶
-
EPISODE_CLS
¶ alias of
grobber.anime.models.episode.SourceEpisode
-
EXPIRE_TIME
= 1800¶
-
INCLUDE_CLS
= True¶
-
PRELOAD_ATTRS
= ('media_id', 'is_dub', 'language', 'title', 'thumbnail', 'episode_count')¶
-
__abstractmethods__
= frozenset({'get_episode', 'get_episodes', 'is_dub', 'language', 'search', 'thumbnail', 'title'})¶
-
__annotations__
= {'_episodes': typing.Dict[int, grobber.anime.models.episode.SourceEpisode]}¶
-
__module__
= 'grobber.anime.models.anime'¶
-
-
class
SourceEpisode
(req, *args, **kwargs)[source]¶ Bases:
grobber.anime.models.episode.Episode
,grobber.stateful.Expiring
,abc.ABC
-
ATTRS
= ('stream', 'raw_streams', 'streams', 'poster')¶
-
CHANGING_ATTRS
= ('stream', 'raw_streams', 'streams', 'poster')¶
-
EXPIRE_TIME
= 21600¶
-
__abstractmethods__
= frozenset({'raw_streams'})¶
-
__init__
(req, *args, **kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
__module__
= 'grobber.anime.models.episode'¶
-
-
class
Stream
(*args, **kwargs)[source]¶ Bases:
grobber.stateful.Expiring
,abc.ABC
-
ATTRS
= ('external', 'links', 'poster')¶
-
CHANGING_ATTRS
= ('links',)¶
-
EXPIRE_TIME
= 3600¶
-
HOST
= None¶
-
INCLUDE_CLS
= True¶
-
PRIORITY
= 100¶
-
__abstractmethods__
= frozenset({'external', 'links'})¶
-
__module__
= 'grobber.anime.models.stream'¶
-
coroutine
can_handle
(req)[source]¶ Check whether this Stream class can handle the request.
This operation shouldn’t actually perform any expensive checks. It should merely check whether it’s even possible for this Stream to extract anything from the request.
The default implementation compares the Stream.HOST variable to the host of the request url (www. is stripped!).
-
external
¶ Indicate whether the links provided by this Stream may be used externally.
- Return type
- Returns
true of the links may be used externally, false otherwise
-
persist
¶ Whether this stream should be stored even if there are neither poster nor links in it
- Return type
- Returns
true to save anyway, false otherwise
-