Skip to content

xMohnad/MangaDM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MangaDM - Manga Download Manager

License: MIT Ask DeepWiki PyPI Version

MangaDM is a command-line tool and Python library for downloading manga chapters based on the metadata specified in JSON files.

Table of Contents


Installation

Ensure you have Python installed before proceeding.


Install from PyPI

pip install MangaDM

Install from Source

To install MangaDM directly from the source code:

  1. Clone the Repository

    git clone https://github.com/xMohnad/MangaDM.git
    cd MangaDM
  2. Install MangaDM

    pip install .

CLI Usage

Once installed, you can use the mangadm command to download manga chapters.

Commands

download

  • Purpose: Downloads manga chapters based on a provided JSON file.
  • Arguments:
    • json_file: Path to the JSON file containing manga download details.
  • Options:
    • --dest, -p: Destination path for downloading manga (default is the current directory).
    • --limit, -l: Number of chapters to download (default is -1 for all chapters).
    • --delete/--no-delete, -d: Delete data after successful download.
    • --format, -f: Format for downloaded manga (choices are based on FormatType enum).
    • --update-details/--no-update-details, -u: Update details.json and re-download cover.

configure

  • Purpose: Opens a configuration UI for setting up MangaDM options.

example

  • Purpose: Displays an example JSON structure.

view

  • Purpose: Views the current configuration settings.

reset

  • Purpose: Reset saved settings.

tui

  • Purpose: Open Textual TUI.

completion

  • purpose: the completion command group manages shell completion scripts for the cli tool.

  • subcommands:

    • install: installs shell autocompletion script for the specified shell.

      • arguments:
        • shell: the shell type to install completion for (e.g., bash, zsh, fish).
    • show: displays the autocompletion script for inspection without installing.

      • arguments:
        • shell: the shell type to show completion script for.
    • shells: lists all supported shell types for which completion is available.

General Notes

  • Versioning: The version is displayed with the --version, -V flag.
  • More: Use --help flag in any of the commands.

Library Usage

You can also use MangaDM as a Python library. Here’s how you can use it programmatically:

Example Usage

from mangadm import MangaDM, FormatType

# Create an instance of MangaDM with desired parameters
mangadm = MangaDM(
    json_file="path/to/yourfile.json",
    dest_path="path/to/chapter",
    limit=1,
    delete_on_success=False,
    format=FormatType.cbz,
)

# Start the downloading process
mangadm.start()

Parameters

  • json_file (Path): The path to the JSON file containing manga data.
  • dest_path (str): The destination path where manga chapters will be downloaded. Defaults to the current directory.
  • limit (int): Number of chapters to download. If -1, download all chapters. Defaults to -1.
  • delete_on_success (bool): If True, delete chapter data from JSON after successful download. Defaults to False.
  • format (FormatType): The format in which to save the downloaded manga.

JSON Structure

Below is an example of the JSON structure required for the input file:

{
  "details": {
    "source": "Example Source Name",
    "manganame": "Example Manga Name",
    "cover": "https://example.com/cover.jpg",
    "description": "Example Description",
    "genre": ["genre 1", "genre 2", "etc"],
    "author": "Akutami Gege",
    "artist": "Akutami Gege"
  },
  "chapters": [
    {
      "title": "chapter 256 - Example Title",
      "images": [
        "https://example.com/image1.jpg",
        "https://example.com/image2.jpg",
        "https://example.com/image3.jpg",
        "https://example.com/image4.jpg",
        "etc"
      ]
    },
    {
      "title": "chapter 257 - Example Title",
      "images": [
        "https://example.com/image1.jpg",
        "https://example.com/image2.jpg",
        "https://example.com/image3.jpg",
        "https://example.com/image4.jpg",
        "etc"
      ]
    },
    {
      "title": "chapter 258 - Example Title",
      "images": [
        "https://example.com/image1.jpg",
        "https://example.com/image2.jpg",
        "https://example.com/image3.jpg",
        "https://example.com/image4.jpg",
        "etc"
      ]
    }
  ]
}

The JSON structure provided above illustrates the format expected for input files used by the MangaDM tool. Each JSON file should follow these guidelines:

Structure Breakdown

  • details: Contains metadata about the manga series.
    • source: The source or website where the manga is found.
    • manganame: The name of the manga series.
    • cover: A URL pointing to the cover image of the manga. This is optional but can enhance the metadata.
    • description: A short description of the manga.
    • genre: A list of genres the manga belongs to.
    • author: The name of the author of the manga.
    • artist: The name of the artist responsible for the manga's artwork.
  • chapters: An array of objects, each representing a chapter in the manga.
    • title: The title or number of the chapter.
    • images: A list of URLs where each URL points to an image file, typically representing the pages of the manga chapter.

Contributing

Bug Reports and Feature Requests

If you encounter any issues while using MangaDM or have suggestions for new features, you can open an issue on the GitHub repository. Please provide detailed information about the issue or feature request to help in resolving it more effectively.

About

A command-line tool for downloading manga chapters based on the metadata specified in JSON files.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors