Metadata-Version: 2.4
Name: hooky
Version: 2.5.1
Summary: Stream videos via dlna, or send urls to custom executable.
Author-email: Anthony Camilo <1643025+gargolito@users.noreply.github.com>
Requires-Python: >=3.14
Requires-Dist: aiohttp>=3.13.3
Requires-Dist: aqdlog>=2.1.0
Requires-Dist: async-timeout>=5.0.1
Requires-Dist: async-upnp-client>=0.46.2
Requires-Dist: catt>=0.13.1
Requires-Dist: flask>=3.1.3
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: toml>=0.10.2
Requires-Dist: tomlkit>=0.14.0
Requires-Dist: yt-dlp-ejs>=0.8
Requires-Dist: yt-dlp>=2026.3.17
Description-Content-Type: text/markdown

# Hooky

Hooky is a unified link storage, background processing, and media streaming service. It provides a mobile-friendly web interface (PWA) for managing links and a powerful CLI for streaming media to devices on your local network.

## Features

### 🌐 Web Dashboard (PWA)
- **Command Execution**: Quickly queue batch commands for any shared link.
- **Auto-Streaming**: Automatically detects YouTube links and queues them for streaming.
- **Queue Management**: View and manage the pending stream queue. Reorder items or remove them individually.
- **Mobile Optimized**: Responsive layout designed for readability and touch interaction.
- **Silent Sharing**: Implements the Web Share Target API with an auto-closing window for a seamless mobile experience.
- **Remote Control**: Integrated playback controls (Pause, Resume, Stop) for active streaming sessions.

### 💻 CLI Tool
- **Network Streaming**: Stream local files or remote URLs directly from your terminal.
- **Device Discovery**: Scan for available Chromecast, DLNA/UPnP, and VLC targets.
- **Configurable Defaults**: Set your preferred device in the configuration for one-click streaming.

### ⚙️ Backend & Workers
- **Persistent Queue**: SQLite-backed Queue Manager for reliable, serial execution of batch commands.
- **Shared Stream Server**: Robust resource management using a persistent HTTP server for media delivery.
- **Broad Device Support**: Native support for Chromecast (via `catt`), UPnP/DLNA, and VLC.

## Installation

Hooky is managed with [uv](https://github.com/astral-sh/uv). To install it as a tool in editable mode:

```bash
uv tool install . -e
```

This will make the `hooky` command available globally and link it directly to the source directory.

## Quick Start

1.  **Configure**: Hooky looks for its config at `~/.config/hooky/config.toml`.
2.  **Scan**: Find devices on your network:
    ```bash
    hooky --scan
    ```
3.  **Start Server**: Run the web application:
    ```bash
    hooky
    ```
4.  **Stream**: Use the CLI to stream a file:
    ```bash
    hooky https://www.youtube.com/watch?v=dQw4w9WgXcQ
    ```

## Configuration

Example `~/.config/hooky/config.toml`:

```toml
[http]
listen_host = "0.0.0.0"
listen_port = 8350

[downloader]
downloader = "yt-dlp"
concurrency = 1
remote_components = "ejs:github"
js_runtimes = "node:$HOME/.nvm/versions/node/v22.15.0/bin/node"

[stream]
# Set this to the exact name shown by `hooky --scan`
default_device = "Living Room TV"

[[devices]]
type = "chromecast"

[[devices]]
type = "upnp"

[[devices]]
type = "vlc"
host = "127.0.0.1"
port = 4212
password = "your_password"
```

## Running as a Service

You can run Hooky as a user-level systemd service. Create `~/.config/systemd/user/hooky.service`:

```ini
[Unit]
Description=Hooky: the webhook for me
After=network.target

[Service]
ExecStart=%h/.local/bin/hooky
Restart=always

[Install]
WantedBy=default.target
```

Then enable and start it:
```bash
systemctl --user daemon-reload
systemctl --user enable --now hooky
```

## Data Storage

- **Queue DB**: Managed in `~/.hooky/queue.db`.
- **Logs**: Written to `~/log/hooky.log`.
