Metadata-Version: 2.3
Name: reanimdl
Version: 0.1.1
Summary: An asynchronous anime downloader CLI for reanime.to
Requires-Dist: aiohttp>=3.12
Requires-Dist: av>=19.0.1
Requires-Dist: json5>=0.12
Requires-Dist: m3u8>=6.0,<7
Requires-Dist: platformdirs>=4.13.5
Requires-Dist: pycryptodome>=3.21
Requires-Dist: pywasm>=2.2,<3
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# reanimdl

An asynchronous command-line anime downloader for reanime.to.

It searches the site's public API, resolves the FlixCloud player, downloads
HLS video/audio segments directly, decrypts them, and muxes everything into an
MKV with subtitles, audio tracks, fonts, and chapter markers. Downloaded media
stays in memory; only the final MKV is written to disk.

## Install

```sh
pip install reanimdl
```

## PyAV

[PyAV](https://pyav.org/) is a Pythonic binding for FFmpeg. It bundles its own
FFmpeg libraries, so reanimdl does not require a system `ffmpeg` binary.  It
provides direct access to stream templates, per-stream metadata and disposition,
chapters, and `add_attachment` for embedding subtitle fonts — all without
re-encoding a single frame.  In reanimdl, video, audio, and subtitle streams stay
entirely in memory while PyAV remuxes them directly into a Matroska container,
writing only the final MKV to disk.  No temporary media files are written.

## Usage

### Preferences

Save defaults for the output directory, preferred quality, and audio mode:

```bash
reanimdl preferences -o ~/Videos/Anime -q 720 --audio dual
reanimdl preferences              # show saved preferences
reanimdl preferences --reset      # restore built-in defaults
```

`--audio` accepts `sub`, `dub`, or `dual`. Command-line options on
`reanimdl download` override saved preferences. The preferences file lives in the
platform-specific user config directory chosen by
[`platformdirs`](https://pypi.org/project/platformdirs/), for example:

- Linux: `~/.config/reanimdl/preferences.json`
- macOS: `~/Library/Application Support/reanimdl/preferences.json`
- Windows: `%LOCALAPPDATA%\reanimdl\preferences.json`

### Search

```bash
reanimdl search "solo leveling"
reanimdl s frieren --limit 5
```

Show anime details and episodes:

```bash
reanimdl info solo-leveling-gyycz8
reanimdl episodes solo-leveling-gyycz8
reanimdl eps solo-leveling-gyycz8 --limit 5 --reverse
```

### Download

```bash
# all episodes, best quality up to 1080p
reanimdl download solo-leveling-gyycz8

# episodes 1-3 and 7, English dub
reanimdl download solo-leveling-gyycz8 -e 1-3,7 --dub

# the newest five episodes, 720p, into a specific folder
reanimdl download solo-leveling-gyycz8 --latest 5 -q 720 -o ~/Videos/Anime

# both Japanese and English audio tracks
reanimdl download solo-leveling-gyycz8 -e 1 --dual
```

A title can be passed instead of an ID. If several anime match, `reanimdl`
prints a numbered list and asks you to choose (or use `--yes` to accept the
best match):

```bash
reanimdl download "frieren beyond journeys end" -e 1
```

### Episode selection

`-e/--episodes` accepts:

| Value | Meaning |
| --- | --- |
| `all` or omitted | every episode |
| `1,3,5-8` | explicit numbers and ranges |
| `latest` | the last episode |
| `1-last` | from episode 1 to the end |
| `-5` | the last five episodes |

Use `--latest N` as a shortcut for the newest `N` episodes.

### Download options

| Option | Description |
| --- | --- |
| `-q, --quality N` | preferred vertical resolution (default: saved preference or `1080`) |
| `--audio sub\|dub\|dual` | audio track (default: saved preference or `sub`) |
| `--dub` | shortcut for `--audio dub` |
| `--dual` | shortcut for `--audio dual` |
| `--server HD-1\|HD-2` | pick the CDN/server (default `HD-1`) |
| `-o, --output DIR` | output directory (default: saved preference or `.`) |
| `--workers N` | concurrent segment downloads (default `32`) |
| `-f, --force` | overwrite existing output files |
| `--no-subs` | do not mux subtitles |
| `--no-fonts` | do not attach subtitle fonts |
| `--no-chapters` | do not write chapter markers |
| `-y, --yes` | accept automatic choices / skip confirmation |
| `--quiet` | hide progress and status output |

Files are written as:

```text
<output>/<Anime Title>/<Anime Title> - E01 [1080p] [Sub].mkv
```

Video/audio segments, subtitles, and fonts are kept in memory. PyAV muxes
directly from those in-memory streams into the final MKV, so no temporary media
files are written.

## Disclaimer

Downloading copyrighted material may be illegal where you live. Use this tool
only for content you are allowed to download. The project is not affiliated
with reanime.to, FlixCloud, or their CDNs.
