toktokkie.utils.update package

Submodules

toktokkie.utils.update.MangadexUpdater module

class toktokkie.utils.update.MangadexUpdater.MangadexUpdater(metadata: toktokkie.metadata.base.Metadata.Metadata, args: Dict[str, Any])

Bases: toktokkie.utils.update.Updater.Updater

Class that implements a mangadex updater

classmethod applicable_media_types() → List[toktokkie.enums.MediaType]
Returns

A list of media type with which the updater can be used with

check_latest_chapter_completeness(chapters: List[manga_dl.entities.Chapter.Chapter])

Checks the latest regular chapter for completeness. This is necessary since some groups release their chapters in parts (i.e. 10.1 and then 10.2). manga-dl merges these chapter parts, so we only need to check if the local files has less pages. :param chapters: The chapters for the series :return: None

execute_rename()

Renames the current directory content. Automatically checks if the dry-run flag is set. If it is set, prints out any chapters that would have been renamed :return: None

load_chapters() → Optional[List[manga_dl.entities.Chapter.Chapter]]

Loads chapter information from mangadex.org :return: Either a list of chapters or None if no mangadex ID was found

classmethod name() → str
Returns

The name of the Updater

update()

Executes the update :return: None

update_main_chapters(chapters: List[manga_dl.entities.Chapter.Chapter])

Updates the regular chapters of the series :param chapters: The chapters of the series :return: None

update_special_chapters(chapters: List[manga_dl.entities.Chapter.Chapter])

Updates the special chapters of the series :param chapters: The chapters of the series :return: None

toktokkie.utils.update.TorrentUpdater module

class toktokkie.utils.update.TorrentUpdater.TorrentUpdater(metadata: toktokkie.metadata.base.Metadata.Metadata, args: Dict[str, Any])

Bases: toktokkie.utils.update.TvUpdater.TvUpdater

Class that handles the configuration and execution of an xdcc update

download(download_instructions: List[toktokkie.utils.update.TvUpdater.DownloadInstructions])

Performs a download :param download_instructions: The download instrcutions :return: None

classmethod name() → str
Returns

The name of the Updater

classmethod predefined_patterns() → Dict[str, str]
Returns

Predefined search patterns for this updater

property search_engine
Returns

The search engine to use

classmethod search_engine_names() → Set[str]
Returns

The names of applicable search engines

toktokkie.utils.update.TvUpdater module

class toktokkie.utils.update.TvUpdater.DownloadInstructions(search_result: Any, directory: str, filename: str)

Bases: object

The instructions for a download

__init__(search_result: Any, directory: str, filename: str)

Initializes the download instructions :param search_result: The search result object :param directory: The directory in which to download to :param filename: The filename to which to download to

class toktokkie.utils.update.TvUpdater.Resolution(value)

Bases: enum.Enum

Enum that models the different resolution options

X1080p = '1080p'
X480p = '480p'
X720p = '720p'
class toktokkie.utils.update.TvUpdater.TvUpdater(metadata: toktokkie.metadata.base.Metadata.Metadata, args: Dict[str, Any])

Bases: toktokkie.utils.update.Updater.Updater

Class that handles the configuration and execution of a generic tv updater

classmethod applicable_media_types() → List[toktokkie.enums.MediaType]
Returns

A list of media type with which the updater can be used with

download(download_instructions: List[toktokkie.utils.update.TvUpdater.DownloadInstructions])

Performs a download :param download_instructions: The download instrcutions :return: None

property episode_offset
Returns

The amount of episodes offset from 1 when updating

classmethod json_schema() → Optional[Dict[str, Any]]
Returns

Optional JSON schema for a configuration file

property p_resolution
Returns

The resolution in P-notation (1080p)

Performs a search using the selected search engine :param search_term: The term to search for :param search_regex: The expected regex :return: The search results

classmethod predefined_patterns() → Dict[str, str]
Returns

Predefined search patterns for this updater

property resolution
Returns

The resolution in which to update the series

property search_engine
Returns

The search engine to use

classmethod search_engine_names() → Set[str]
Returns

The names of applicable search engines

property search_name
Returns

The name of the series for searching purposes

property search_pattern
Returns

The search pattern to use

property season
Returns

The season to update

update()

Executes the XDCC Update procedure :return: None

validate()

Checks if the configuration is valid :return: None

property x_resolution
Returns

The resolution in X-notation (1920x1080)

toktokkie.utils.update.Updater module

class toktokkie.utils.update.Updater.Updater(metadata: toktokkie.metadata.base.Metadata.Metadata, args: Dict[str, Any])

Bases: object

Class that defines the common behaviour of Updaters

__init__(metadata: toktokkie.metadata.base.Metadata.Metadata, args: Dict[str, Any])

Initializes the Updater object :param metadata: The metadata belonging to the media to update :param args: The command line arguments used to configure the Updater

classmethod applicable_media_types() → List[toktokkie.enums.MediaType]
Returns

A list of media type with which the updater can be used with

classmethod json_schema() → Optional[Dict[str, Any]]
Returns

Optional JSON schema for a configuration file

classmethod name() → str
Returns

The name of the Updater

classmethod prompt(metadata: toktokkie.metadata.base.Metadata.Metadata)

Prompts the user for information to create a config file :param metadata: The metadata of the media for which to create an

updater config file

Returns

None

update()

Executes the update :return: None

classmethod update_file(meta_dir: str) → str

Generates the path to the update file :param meta_dir: The meta directory :return:

validate()

Checks if the configuration is valid :return: None

toktokkie.utils.update.XDCCUpdater module

class toktokkie.utils.update.XDCCUpdater.XDCCUpdater(metadata: toktokkie.metadata.base.Metadata.Metadata, args: Dict[str, Any])

Bases: toktokkie.utils.update.TvUpdater.TvUpdater

Class that handles the configuration and execution of an xdcc update

property bot
Returns

The bot to use for updating

download(download_instructions: List[toktokkie.utils.update.TvUpdater.DownloadInstructions])

Performs a download :param download_instructions: The download instrcutions :return: None

classmethod json_schema() → Optional[Dict[str, Any]]
Returns

Optional JSON schema for a configuration file

classmethod name() → str
Returns

The name of the Updater

Performs a search using the selected search engine :param search_term: The term to search for :param search_regex: The expected regex :return: The search results

classmethod predefined_patterns() → Dict[str, str]
Returns

Predefined search patterns for this updater

property search_engine
Returns

The search engine to use

classmethod search_engine_names() → Set[str]
Returns

The names of applicable search engines

Module contents

toktokkie.utils.update.perform_update(args: Dict[str, Any], metadata: toktokkie.metadata.base.Metadata.Metadata, applicable_updaters: List[Type[toktokkie.utils.update.Updater.Updater]])

Performs updates on metadata :param args: The CLI arguments :param metadata: The metadata :param applicable_updaters: The applicable updater classes :return: None

toktokkie.utils.update.updaters = [<class 'toktokkie.utils.update.MangadexUpdater.MangadexUpdater'>, <class 'toktokkie.utils.update.XDCCUpdater.XDCCUpdater'>, <class 'toktokkie.utils.update.TorrentUpdater.TorrentUpdater'>]

List of all available updaters