Download Chapter
Downloads a manga chapter to the specified path using provided downloader and saver adapters. This method supports threaded downloads for faster processing.
Parameters:
path
: Filesystem path where the chapter should be saved.chapter
: The manga chapter to download.downloader
: Adapter for downloading chapter pages.saver
: Adapter for saving the downloaded pages.threaded
: Determines whether the download should be performed in a threaded manner.
Raises:
SourceWasNotDefined
if no source has been set before calling this method.
# Example to download a chapter of a manga
from enma import (
DefaultDownloader,
LocalStorage,
Threaded
)
path = "./downloads"
chapter = Chapter(id="1", pages=[], link=None) # Example chapter object
downloader = DefaultDownloader()
saver = LocalStorage()
enma.download_chapter(
path=path,
chapter=chapter,
downloader=downloader,
saver=saver,
threaded=Threaded(use_threads=True, number_of_threads=4)
)
print("Chapter downloaded successfully.")
Last updated
Was this helpful?