Autodl¶
-
class
modules.autodl.commands.
Controller
(output: str = '.', quiet: bool = False, tiny: bool = False)¶ Object responsible of the autodl part of the program, all the logic related to it passes here
-
__init__
(output: str = '.', quiet: bool = False, tiny: bool = False)¶ Initializes this instance of the autodl controller. If there is no json database for autodl currently in existence a new one is created at
pyscandl/modules/autodl/db.json
.Parameters: - output (str) – location where the outputted scans should be stored
- quiet (bool) – should the program not output any information about what it is doing in the console
- tiny (bool) – should the name of every downloaded scan be minified and only include the chapter number and the chapter title
-
add
(name: str, rss: str, link: str, fetcher: str, chapters: list = None, archived=False)¶ Adds a new scan entry to the
db.json
file.Parameters: - name (str) – name of the manga
- rss (str) – rss link of the manga
- link (str) – link to the page of the manga (same link that is used for the -l arg in other uses of pyscandl)
- fetcher (str) – name of the associated fetcher
- chapters (list[int/float/str]) – list of the already possessed chapters that wont be downloaded again (Optional)
- archived (bool) – tell if the chapter is considered archived and if it’ll be downloaded with autodl
Raises: - FetcherNotFound – the specified fetcher doesn’t exist
- IsStandalone – the specified fetcher is a standalone fetcher
-
db_export
(path: str)¶ Saves a copy of the current database to the file path specified.
Parameters: path (str) – path to the save location, may be either a file or a folder, if it is a folder the filename will be db.json Raises: TypeError – if you specify the file name in the destination, the file extension must be .json
-
db_import
(path: str)¶ Takes an external json file path and put its content as the new database for pyscandl.
Parameters: path (str) – path to the .json file to import as the database for autodl and manga
-
delete_manga
(name)¶ Deletes a manga from the
db.json
file.Parameters: name – name of the manga Returns: confirms the deletion Return type: bool
-
download
(name: str, pdf: bool = True, keep: bool = False, image: bool = False)¶ Start the download of the chapters of the asked manga that have their number in the scan results.
Parameters: - name (str) – name of the manga
- pdf (bool) – tell if the result should be kept as a pdf
- keep (bool) – tell if the result should be kept as a pdf and as a collection of images
- image (bool) – tell if the result should be kept as a collection of images
-
edit
(name: str, rss: str = None, link: str = None, fetcher=None, chapters: list = None, archived=None)¶ Edits an already existing entry in the
db.json
file. The :param name: is mandatory to find the correct entry and every other parameter specified will overwrite the existing values.Parameters: - name (str) – name of the manga
- rss (str) – rss link of the manga
- link (str) – link to the page of the manga (same link that is used for the -l arg in other uses of pyscandl)
- fetcher (str) – name of the associated fetcher
- chapters (list[int/float/str]) – list of the already possessed chapters that wont be downloaded again
- archived (bool) – tell if the chapter is considered archived and if it’ll be downloaded with autodl
Raises: IsStandalone – the specified fetcher is a standalone fetcher
-
list_mangas
(all=False, only=False)¶ Gives the list of all the names of the mangas in the
db.json
file. if the db is empty, returns NoneParameters: - all (bool) – get also the archived mangas
- only (bool) – get only the archived mangas
Return type: list
-
manga_info
(name)¶ Fet the infos about a specific manga.
Parameters: name (str) – name of the manga Return type: dict
-
rm_chaps
(name, *rm_chaps)¶ Remove the listed chapters from the asked manga
Parameters: - name (str) – name of he manga
- rm_chaps (str) – list of all the chapters that have to be removed
Returns: confirms the deletion
Return type: bool
-
save
()¶ Saves the current state of the database in the
db.json
file.
-
scan
(name: str)¶ Scans the asked manga for new and non downloaded chapters and adds them to the controller queue.
Parameters: name (str) – name of the manga
-