Utilities

This package provides two sets of utility functions for each source type.

It is important to note, that the following functions return the types and the source instantiating is left to you.

This gives you the opportunity to inject your own http gateway and override the default behaviour. Check out the Gateways section for more information.

Retrieve all novel sources

novelsave_sources.novel_source_types() List[Type[novelsave_sources.sources.novel.source.Source]][source]

Return all the available novel source types

The first usage may be slow as it searches for all the source implementations and caches the results.

Returns

All the novel source scraper implementations

Return type

List[Type[Source]]

Find the novel source that can parse a specific url

novelsave_sources.locate_novel_source(url: str) Type[novelsave_sources.sources.novel.source.Source][source]

Locate and return the novel source parser for the url if it is supported

Parameters

url (str) – Url pointing to the novel or the chapter needing to be scraped.

Returns

Specific novel scraper that supports the url provided.

Return type

Type[Source]

Raises

UnknownSourceException – if the url cannot be parsed by any existing source schema

Retrieve all metadata sources

novelsave_sources.metadata_source_types() List[Type[novelsave_sources.sources.metadata.metasource.MetaSource]][source]

Locate and return all the metadata source types

The first usage may be slow as it searches for all the source implementations and caches the results.

Returns

All the metadata source scraper implementations

Return type

List[Type[MetaSource]]

Find the metadata source that can parse a specific url

novelsave_sources.locate_metadata_source(url: str) Type[novelsave_sources.sources.metadata.metasource.MetaSource][source]

Locate and return the metadata source parser for the url if it is supported

Parameters

url (str) – Url pointing to the metadata profile.

Returns

Specific metadata scraper that supports the url provided.

Return type

Type[MetaSource]

Raises

UnknownSourceException – if the url cannot be parsed by any existing source schema