Metadata-Version: 2.4
Name: pb-downloader
Version: 1.0.0
Summary: CLI video downloader — fast parallel segments, resumable, no browser needed.
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28
Requires-Dist: rich>=13.0
Requires-Dist: tqdm>=4.64
Requires-Dist: InquirerPy>=0.3.4
Requires-Dist: pyfiglet>=1.0
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# p1_pkg

Fast, parallel video downloader — no browser, no ffmpeg, no nonsense.

## Install

```bash
pip install p1_pkg
```

## Usage

```bash
# Interactive (search + fuzzy pick + quality select)
p1

# Search directly
p1 -s "search term"

# Paste a URL
p1 -u "https://pimpbunny.com/videos/some-video/"

# Force quality
p1 -s "search term" -q 720p

# Control parallel threads (default 8)
p1 -s "search term" -t 16

# Save defaults
p1 --set-quality 1080p
p1 --set-threads 12
p1 --set-download-dir ~/Videos

# Show config
p1 --config
```

## How it works

- Establishes a session to collect short-lived signed tokens
- Parses the video page for all available quality URLs (360p / 480p / 720p / 1080p)
- Resolves the signed URL through a CDN redirect
- Splits the MP4 into N equal byte-range chunks and downloads them in parallel threads
- Merges automatically — the output file is pre-allocated and each thread writes to its own offset
- Resume-safe: completed downloads are tracked in `~/.p1_pkg_done/`

## Options

| Flag | Description |
|---|---|
| `-s QUERY` | Search query |
| `-u URL` | Direct video page URL |
| `-q QUALITY` | `best` / `1080p` / `720p` / `480p` / `360p` |
| `-t N` | Parallel threads (default 8) |
| `-d DIR` | Download directory |
| `--config` | Show saved settings |
| `--set-quality Q` | Save default quality |
| `--set-threads N` | Save default thread count |
| `--set-download-dir PATH` | Save default directory |
| `--reset-config` | Reset to defaults |
