Metadata-Version: 2.4
Name: movie-tui
Version: 0.1.3
Summary: Authenticated movie archive search and download TUI
Author: Movie TUI Contributors
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31
Requires-Dist: rich>=13.7
Requires-Dist: textual>=0.47

# Movie TUI

Authenticated terminal search and download application for the archive API.

## Install

```bash
python3 -m venv .venv
.venv/bin/pip install -e .
```

Run it with:

```bash
.venv/bin/movie-tui
# or
.venv/bin/python -m movie_tui
```

The first launch opens the authentication screen. Enter the Bearer token
without the `Bearer ` prefix. The token is stored in `/z_tasks/z_movies/token.txt`
with owner-only permissions (`0600`). It is not written to the TOML settings
file.

For a one-session/headless environment, use:

```bash
MOVIE_API_TOKEN='token' .venv/bin/movie-tui
```

`MOVIE_API_TOKEN` is an optional temporary override. You can also select a
different token-file location with `MOVIE_TOKEN_FILE=/path/to/token.txt`.

Rotate any token that has been pasted into chat, shell history, or logs.

## Workflow

- Search from the Search screen.
- Select a result to inspect its filename, quality, size, and archive ID.
- Choose **Add to download queue**.
- The queue generates a temporary direct link and starts the downloader.
- Downloads use `.part` files, delete failed partials, and retry from byte zero.
- Pause preserves the `.part` file. Resume continues from its byte offset when
  the server supports HTTP ranges; otherwise it automatically restarts at zero.
- Complete files are atomically renamed after size verification.

The Search and Queue screens use formatted mouse-friendly tables. Select a
row and use the visible controls to queue, pause, resume, cancel, retry, or
open a generated direct link. The Details screen also provides a clickable
browser link after refreshing a file link.

Global keys: `q` quit, `?` help, `s` search, `d` queue, `h` history, `,`
settings, and `Esc` back.

## Settings

Preferences are stored at:

```text
~/.config/movie-tui/config.toml
```

History is stored at:

```text
~/.local/share/movie-tui/history.sqlite3
```

The existing batch downloader remains available:

```bash
./dl.sh new-links.txt -j 6 -c 4 -r 5
```

It continues to support servers that ignore byte ranges and always removes
failed partial downloads.
