Metadata-Version: 2.4
Name: kizamu-manga
Version: 1.0.0
Summary: CLI to search and download manga chapters -> exported to CBZ.
Author-email: Cocera Cia <coceraciamiguel@gmail.com>
License: MIT License
        
        Copyright (c) 2025 CoceraCia
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights 
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
        copies of the Software, and to permit persons to whom the Software is 
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all 
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
        SOFTWARE.
        
        ----------------------------------------
        DISCLAIMER:
        This project has been created for educational and learning purposes only.
        The author is not responsible for the use that third parties may make of this software.
        It does not encourage or promote the download or distribution of copyrighted material.
        
Project-URL: Homepage, https://github.com/CoceraCia/KizamuManga
Project-URL: Repository, https://github.com/CoceraCia/KizamuManga
Keywords: manga,scraping,downloader,playwright,cbz,cli,comic,asynchronous
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.12.14
Requires-Dist: beautifulsoup4>=4.13.4
Requires-Dist: playwright>=1.54.0
Requires-Dist: rich>=14.1.0
Requires-Dist: tenacity>=9.1.2
Requires-Dist: tomlkit>=0.13.3
Requires-Dist: pillow>=11.3.0
Requires-Dist: opencv-python>=4.12.0.88
Requires-Dist: numpy>=2.2.6
Dynamic: license-file

<p align="center"><img width="300" alt="KizamuManga" src="https://github.com/user-attachments/assets/153c6620-7461-4ffe-a399-69aa9f03b885" /></p>

# 📚 KizamuManga  ![State](https://img.shields.io/badge/state-development-yellow) ![License](https://img.shields.io/badge/license-MIT-blue.svg)

**KizamuManga** is a command-line tool to **search, download, and convert manga chapters into CBZ files** from different online sources.

## ✨ Main Features

- 🔎 **Interactive search** for manga and chapter selection directly from the terminal.
- ⚡ **Asynchronous downloads** with concurrency control, automatic CBZ export, and cleanup of temporary files.
- 🖼️ **Optional image processing**: grayscale conversion, margin cropping, and proportional resizing.
- 🌐 **Multi-source support** (WeebCentral, InManga, and LeerMangaEsp) with an extensible scraping system based on Playwright.
- 📊 **Progress indicators and rotating logs** for easy tracking of execution.
  ##⚡Quick Start

1. Clone the repository and enter the project folder

```bash
git clone https://github.com/CoceraCia/KizamuManga.git
```

2. Enter the project repo

```bash
cd KizamuManga
```

3. install requirements and playwright browsers

```bash
pip install -r requirements.txt && playwright install
```

4. start searching or installing a manga

```bash
python -m kizamumanga.main search "One Piece"
python -m kizamumanga.main install "One Piece"
```

## 🧾 Requirements

- Python **3.9 or higher**.
- Dependencies listed in `requirements.txt`.
- Playwright installed along with its browsers (`playwright install`).
- Access to the supported websites to fetch online chapters.

## ⚙️ Installation

1. Clone the repository and enter the project folder.
2. (Optional) Create and activate a virtual environment.
3. Install dependencies: `pip install -r requirements.txt`
4. Install Playwright browsers: `playwright install`

## 🔧 Configuration

The `config.toml` file (at the project root) allows customization of parameters such as:

| Key                    | Description                                                      |
| ---------------------- | ---------------------------------------------------------------- |
| `cbz_path`           | Destination folder for CBZ files (default:`manga_downloads`).  |
| `website`            | Active source (`weeb_central`, `inmanga`, `leermangaesp`). |
| `multiple_tasks`     | Maximum number of concurrent downloads.                          |
| `color`              | Export in color (`true`) or grayscale (`false`).             |
| `cropping_mode`      | Enable automatic margin cropping.                                |
| `width` / `height` | Target resolution; leave empty to keep original size.            |

You can also modify configuration from the terminal:

- Change scraper and concurrency: `python -m kizamumanga.main config scraper --website inmanga --multiple_tasks 5`
- Change output folder: `python -m kizamumanga.main config paths --cbz_path "./my_manga"`
- Apply predefined resolution profile: `python -m kizamumanga.main config dimensions --device boox_go_7`

## 🕹️ Basic Usage

- Search for manga: `python -m kizamumanga.main search "One Piece"`
- Download all chapters: `python -m kizamumanga.main install "One Piece"`
- Download a specific chapter or range:
  - `python -m kizamumanga.main install "One Piece" 5`
  - `python -m kizamumanga.main install "One Piece" 10-15`
    CBZ files are saved in the folder defined by `cbz_path`.

## 🔄 Internal Workflow

1. The **Runner** validates arguments, loads configuration, and sets up the selected scraper.
2. Manga and chapter lists are fetched using **Playwright + BeautifulSoup**.
3. Each chapter is downloaded via `aiohttp`, optionally processed, and packed into a **CBZ**.

## 🗂️ Project Structure

```bash
├── config.toml
├── pyproject.toml
├── requirements.txt
└── src/
    └── kizamumanga/
        ├── main.py
        ├── handlers/
        │   └── args_handler.py
        ├── engine/
        │   ├── runner.py
        │   ├── downloader.py
        │   ├── image_converter.py
        │   └── paths.py
        ├── scraping/
        │   ├── base.py
        │   ├── weeb_central.py
        │   ├── inmanga.py
        │   └── leermangaesp.py
        └── utils/
            ├── logger.py
            ├── loading_spinner.py
            └── general_tools.py
```

## 📜 License

This project is under the license [MIT](LICENSE).
