Metadata-Version: 2.4
Name: misato
Version: 1.0.4
Summary: MissAV video downloader
Author: Misato Contributors
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: curl_cffi>=0.7.0
Requires-Dist: playwright>=1.43.0
Requires-Dist: pydantic>=2.7.0
Requires-Dist: pydantic-settings>=2.2.0
Requires-Dist: tqdm>=4.66.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# misato 🎬

MissAV video downloader — multi-threaded, resumable, headless.

[![PyPI](https://img.shields.io/pypi/v/misato)](https://pypi.org/project/misato/)
[![Python](https://img.shields.io/pypi/pyversions/misato)](https://pypi.org/project/misato/)

## 🚀 Quick Start

```bash
pip install misato
playwright install chromium

# Download a video
misato -auto "https://missav.ws/dm13/sprd-355" -ffcover -title

# Search by code
misato -search SPRD-355 -ffcover
```

## ✨ Features

- 🥷 **Headless** — Playwright Chromium, no system Chrome install
- 🛡️ **Cloudflare bypass** — automatic anti-detection, no config needed
- ⚡ **Multi-threaded** — all CPU cores blazing
- 🔄 **Resume** — interrupted downloads pick up where they left off
- 🔁 **Auto-retry** — failed segments retried with 2× persistence
- 📊 **Live progress** — speed + ETA, no retry spam in your face

## 🧠 How It Works

```
misato
  │
  ├─ 🥷 Headless Chromium (launched once, reused)
  │   └─ bypasses Cloudflare JS challenge
  │   └─ extracts video UUID + title from page HTML
  │
  ├─ 🦊 curl_cffi (Chrome TLS fingerprint)
  │   └─ downloads m3u8 playlists & .jpeg segments
  │   └─ connection pooling keeps it fast
  │
  └─ 🎞️ FFmpeg (optional)
      └─ merges segments into .mp4
      └─ embeds cover as video thumbnail
```

## 📦 Usage

```bash
# 🎯 Single video
misato -auto "https://missav.ws/dm87/pppd-695" -ffcover -title

# 🔍 Search
misato -search PPPD-695 -ffcover -title

# 📚 Batch from playlist / actress page
misato -auto "https://missav.ws/actresses/JULIA" -limit 20 -ffmpeg

# 📄 From a URL list file (one per line)
misato -file urls.txt -title

# 🌐 With proxy
misato -auto "https://..." -proxy 127.0.0.1:7890
```

### ⚙️ Options

| Flag | Description |
|------|-------------|
| `-auto URL [URL ...]` | 🎯 Video or playlist URLs |
| `-search CODE` | 🔍 Search by video code |
| `-file PATH` | 📄 Read URLs from a text file |
| `-limit N` | 🛑 Max videos to download |
| `-proxy host:port` | 🌐 HTTP/HTTPS proxy |
| `-ffmpeg` | 🎞️ Merge segments with FFmpeg |
| `-cover` | 🖼️ Download cover image |
| `-ffcover` | 🖼️+🎞️ Cover + FFmpeg + embed as thumbnail |
| `-title` | 🏷️ Use full video title as filename |
| `-quality 720` | 📐 Preferred resolution (default: highest) |
| `-threads N` | 🧵 Download threads (default: CPU count) |
| `-retry N` | 🔁 Retries per segment (default: 5) |
| `-delay N` | ⏱️ Seconds between retries (default: 2) |
| `-timeout N` | ⏳ Timeout per segment (default: 15) |
| `-noban` | 🙈 Suppress the ASCII banner |

### 🔗 Supported URL Types

`-auto` auto-detects single videos vs playlists:

- 🎬 Video: `https://missav.ws/dm13/sprd-355`
- 👩 Actress: `https://missav.ws/actresses/JULIA`
- 🔍 Search: `https://missav.ws/search/JULIA?filters=uncensored-leak`
- 🏷️ Genre: `https://missav.ws/genres/4K`
- 🏢 Studio: `https://missav.ws/makers/Takara%20Visual`
- 📋 Playlist: `https://missav.ws/playlists/ewzoukev`

> 💡 Wrap URLs with spaces or special chars in double quotes.

## 📋 Requirements

| Dependency | Required? | Notes |
|------------|-----------|-------|
| 🥷 Playwright Chromium | ✅ | `playwright install chromium` |
| 🎞️ FFmpeg | ⚠️ recommended | For merging + cover embedding |

No system Chrome. No profile setup. Cross-platform.

## ⚠️ Disclaimer

This software is provided **as-is**, without warranty of any kind, express or implied. The authors and contributors assume **no liability** for any damages, legal consequences, or losses arising from the use or misuse of this software.

- This tool is intended for **educational and research purposes only** — to study web automation, networking, and media processing techniques.
- **You** are solely responsible for ensuring your use complies with all applicable local, national, and international laws and regulations.
- Downloading copyrighted material without authorization from the rights holder **may constitute copyright infringement**. The authors do not condone or encourage such activity.
- The authors are **not affiliated** with any third-party websites or services this tool interacts with.
- By using this software, you acknowledge that you have read, understood, and agree to assume **all risks and liabilities** associated with its use.

If you do not agree with these terms, do not use this software.

See [LICENSE](LICENSE).
