Metadata-Version: 2.4
Name: bato-downloader
Version: 7.3
Summary: A beautiful manga downloader for Bato.to with PyQt6 GUI and Rich CLI
Author-email: Yui007 <akrtrt782@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Yui007/bato_downloader
Project-URL: Repository, https://github.com/Yui007/bato_downloader
Project-URL: Issues, https://github.com/Yui007/bato_downloader/issues
Keywords: manga,downloader,bato,batoto,comic,webtoon
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: End Users/Desktop
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyQt6>=6.0.0
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: requests>=2.28.0
Requires-Dist: Pillow>=9.0.0
Provides-Extra: dev
Requires-Dist: pyinstaller; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

<div align="center">

# 📚 Bato.to Manga Downloader

[![PyPI](https://img.shields.io/pypi/v/bato-downloader?style=for-the-badge&logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/bato-downloader/)
[![Python](https://img.shields.io/badge/Python-3.8+-blue?style=for-the-badge&logo=python&logoColor=white)](https://python.org)
[![PyQt6](https://img.shields.io/badge/PyQt6-GUI-green?style=for-the-badge&logo=qt&logoColor=white)](https://pypi.org/project/PyQt6/)
[![License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](LICENSE)

**Beautiful manga downloader for xbat.tv (formerly bato.to)**

*Search, browse, and download your favorite manga with ease*

![GUI Screenshot](GUI.PNG)

</div>

---

## ✨ Features
<div align="center">
<table>
<tr>
<td width="50%">

### 🔍 Smart Search
- Search by manga title
- Card-based results with covers
- Authors, genres & ratings display
- Pagination support

</td>
<td width="50%">

### 📥 Powerful Downloads
- Concurrent chapter downloads
- Parallel image fetching
- Progress tracking
- Resume support

</td>
</tr>
<tr>
<td width="50%">

### 📁 Multiple Formats
- **Images** - Raw image files
- **PDF** - Single file per chapter
- **CBZ** - Comic book archive

</td>
<td width="50%">

### 🎨 Two Interfaces
- **GUI** - Beautiful PyQt6 interface
- **CLI** - Interactive Rich terminal

</td>
</tr>
</table>
</div>

---

## 🚀 Installation

### Option 1: Install from PyPI (Recommended)

```bash
# Install from PyPI
pip install bato-downloader

# Launch GUI
bato-downloader-gui

# Launch CLI
bato-downloader
```

> ✅ That's it! All dependencies are installed automatically.

### Option 2: Download Executables

| Platform | GUI | CLI |
|----------|-----|-----|
| Windows | [📥 BatoDownloaderGUI.exe](https://github.com/Yui007/bato_downloader/releases) | [📥 BatoDownloaderCLI.exe](https://github.com/Yui007/bato_downloader/releases) |

> Just download and run - no Python needed!

---

## 🖥️ Graphical User Interface

<div align="center">

| Search | Manga Details | Settings |
|--------|---------------|----------|
| Search by title | View chapters | Configure downloads |
| Cover previews | Select multiple | Set output format |
| One-click select | Download progress | Adjust concurrency |

</div>

### How to Use

1. **🔍 Search** - Enter manga name and press Search
2. **👆 Select** - Click a result card to view details
3. **☑️ Choose** - Select chapters you want to download
4. **📥 Download** - Click "Download Selected" and wait

---

## 💻 Command-Line Interface

```
╭────────────────────────────────────────╮
│       📚 BATO DOWNLOADER 📚            │
╰────────────────────────────────────────╯

Main Menu

  [1] 📥 Download Manga by URL
  [2] 🔍 Search For Manga
  [3] ⚙️  Settings
  [4] 🚪 Exit

Select option [1/2/3/4]:
```

### Direct Commands

```bash
# Interactive mode
bato-downloader

# Search for manga
bato-downloader search "Solo Leveling"

# Download from URL
bato-downloader download "https://xbat.tv/title/81514-solo-leveling"
```

---

## ⚙️ Configuration

Settings are saved in `config.json`:

| Setting | Options | Default |
|---------|---------|---------|
| 📁 `download_format` | `images` / `pdf` / `cbz` | `images` |
| 📂 `output_directory` | Any path | Current folder |
| ⚡ `concurrent_chapters` | 1-10 | `3` |
| 🖼️ `concurrent_images` | 1-20 | `5` |
| 💾 `keep_images_after_conversion` | `true` / `false` | `true` |

---

## 📁 Project Structure

```
bato_downloader/
├── 🚀 main.py              # GUI entry point
├── 🖥️ cli.py               # CLI entry point
├── 📁 gui/
│   ├── main_window.py      # Main window
│   ├── workers.py          # Background threads
│   ├── styles.py           # Theme & colors
│   └── widgets/            # UI components
├── 📁 src/
│   ├── config.py           # Settings
│   ├── scraper/            # Web scraping
│   └── downloader/         # Download logic
├── 🔧 build_gui.bat        # Build GUI
├── 🔧 build_cli.bat        # Build CLI
└── 🔧 build_all.bat        # Build both
```

---

## 📦 Dependencies

| Package | Purpose |
|---------|---------|
| ![PyQt6](https://img.shields.io/badge/PyQt6-GUI-41CD52?style=flat-square&logo=qt) | Modern GUI framework |
| ![Typer](https://img.shields.io/badge/Typer-CLI-000?style=flat-square) | CLI framework |
| ![Rich](https://img.shields.io/badge/Rich-Terminal-purple?style=flat-square) | Beautiful terminal output |
| ![Requests](https://img.shields.io/badge/Requests-HTTP-blue?style=flat-square) | HTTP requests |
| ![Pillow](https://img.shields.io/badge/Pillow-Images-yellow?style=flat-square) | Image processing |

---

## ❓ Troubleshooting

<details>
<summary><b>🖼️ Cover images not loading</b></summary>

- Check your internet connection
- Covers load asynchronously, wait a moment
- Try refreshing the search

</details>

<details>
<summary><b>⏱️ Download timeouts</b></summary>

- Reduce `concurrent_chapters` in settings (try 1-2)
- Reduce `concurrent_images` in settings
- Check if the site is accessible

</details>

<details>
<summary><b>❌ Invalid URL error</b></summary>

- URL must contain `bato` or `xbat` and `/title/`
- Example: `https://xbat.tv/title/81514-solo-leveling`

</details>

<details>
<summary><b>📄 PDF conversion fails</b></summary>

```bash
pip install Pillow --upgrade
```

</details>

---

## 🛠️ Development

### Install from Source

```bash
# Clone the repository
git clone https://github.com/Yui007/bato_downloader.git
cd bato_downloader

# Install in development mode
pip install -e .

# Run directly
bato-downloader      # CLI
bato-downloader-gui  # GUI

# Or run scripts directly
python cli.py
python main.py
```

### Building Executables

```bash
# Build GUI only
.\build_gui.bat

# Build CLI only
.\build_cli.bat

# Build both at once
.\build_all.bat
```

**Output:**
```
dist/
├── BatoDownloaderGUI.exe   # 🖼️ Windowed application
└── BatoDownloaderCLI.exe   # 💻 Console application
```

---

<div align="center">

## 📜 License

This project is licensed under the **MIT License**

Made with ❤️ by [Yui007](https://github.com/Yui007)

⭐ Star this repo if you find it useful!

</div>
