Metadata-Version: 2.4
Name: bookdownloader
Version: 1.0.0
Summary: Search and download books from Anna's Archive with PDF copyright removal
License: MIT
Requires-Python: >=3.10
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: playwright-stealth>=1.0.0
Requires-Dist: playwright>=1.40.0
Requires-Dist: pymupdf>=1.23.0
Requires-Dist: requests>=2.31.0
Requires-Dist: tqdm>=4.66.0
Description-Content-Type: text/markdown

# BookDownloader

Search and download books from Anna's Archive, with optional PDF copyright text removal.

## Quick Install

**macOS** (requires Python 3.10+):
```bash
curl -fsSL https://raw.githubusercontent.com/sudhirpatil/BookDownloader/main/install.sh | bash
```

**Windows** (requires Python 3.10+):  
Download and double-click `install.bat`

**Via pip/pipx** (any platform):
```bash
pipx install bookdownloader
bookdownloader-setup   # one-time: installs Chromium (~130 MB)
```

---

## Commands

| Command | Description |
|---------|-------------|
| `bookdownloader` | Search & download books |
| `pdf-cleaner` | Remove copyright text from a PDF |
| `bookdownloader-all` | Download + auto-clean in one step |

---

## Usage

### Search and download a book
```bash
bookdownloader "atomic habits"
bookdownloader "atomic habits" -f epub        # filter by format
bookdownloader "atomic habits" -f pdf -a      # auto-select top result
bookdownloader "atomic habits" -o ~/Downloads # custom output directory
```

### Remove copyright text from a PDF
```bash
pdf-cleaner /path/to/book.pdf
pdf-cleaner /path/to/book.pdf -o /path/to/cleaned.pdf
pdf-cleaner /path/to/book.pdf --dry-run -v    # preview what would be removed
```

### Download and clean in one step
```bash
bookdownloader-all "atomic habits" -f pdf
bookdownloader-all "atomic habits" -f pdf -a -v
```

### Options
```
-f, --format FMT    Format filter: epub, pdf, mobi, etc. (default: any)
-l, --lang LANG     Language filter (default: en)
-o, --output DIR    Output directory (default: ~/Books)
-a, --auto          Auto-select top result without prompts
-v, --verbose       Print each removed copyright item
```

---

## Requirements

- Python 3.10+
- Google Chrome installed (for bypassing download page protection)

---

## Development

```bash
git clone https://github.com/sudhirpatil/BookDownloader
cd BookDownloader
python -m venv .venv && source .venv/bin/activate
pip install -e .
bookdownloader-setup
```
