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]}
__eq__(other)[source]

Return self==value.

Return type

bool

__hash__()[source]

Return hash(self).

Return type

int

__module__ = 'grobber.anime.models.anime'
__repr__()[source]

Return repr(self).

Return type

str

classmethod deserialise_special(key, value)[source]
Return type

Any

dirty
Return type

bool

episode_count
Return type

int

episodes
Return type

Dict[int, SourceEpisode]

coroutine get(self, index)[source]
Return type

SourceEpisode

coroutine get_episode(self, index)[source]
Return type

SourceEpisode

coroutine get_episodes(self)[source]
Return type

Union[List[Optional[SourceEpisode]], Dict[int, SourceEpisode]]

classmethod get_source_id()[source]
Return type

str

id
Return type

str

coroutine preload_attrs(self, *attrs, recursive=False)[source]
Return type

List[Any]

request_save()[source]
Return type

Future

coroutine search(query, *, dubbed=False, language=<Language.ENGLISH: 'en'>)[source]
Return type

Asynciterator[Forwardref]

serialise_special(key, value)[source]
Return type

~BsonType

source_id
Return type

str

coroutine to_dict(self)[source]
Return type

Dict[str, ~BsonType]

uid
Return type

UID

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'
__repr__()[source]

Return repr(self).

Return type

str

classmethod deserialise_special(key, value)[source]
Return type

Any

dirty
Return type

bool

serialise_special(key, value)[source]
Return type

~BsonType

coroutine to_dict(self)[source]
Return type

Dict[str, ~BsonType]

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'
__repr__()[source]

Return repr(self).

Return type

str

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!).

Parameters

req (Request) – request to stream to check

Return type

bool

Returns

true if this Stream may be able to extract something from the size, false otherwise

external

Indicate whether the links provided by this Stream may be used externally.

Return type

bool

Returns

true of the links may be used externally, false otherwise

Return type

List[str]

Return type

List[str]

persist

Whether this stream should be stored even if there are neither poster nor links in it

Return type

bool

Returns

true to save anyway, false otherwise

poster
Return type

Optional[str]

coroutine to_dict(self)[source]
Return type

Dict[str, ~BsonType]

working
Return type

bool

working_external_self
Return type

Optional[Stream]

class Source(mime_type, src)[source]

Bases: object

class SearchResult(anime, certainty)[source]

Bases: object

coroutine to_dict(self)[source]
Return type

Dict[str, Any]