Skip to content
wthuebPublic

About

Discord bot for easy Plex/Radarr integration.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

wi1-bot

Integrates Radarr & Sonarr with Discord (commands like !addmovie, !downloads) and transcodes downloads with ffmpeg.

It is a uv workspace of five packages — two shared libraries and three independently deployable services (each with its own config file and Docker image):

Package Import What it is
common wi1_bot.common shared logging + pushover helpers (library)
arr wi1_bot.arr Radarr/Sonarr (pyarr) wrapper (library)
wi1-bot wi1_bot.bot the Discord bot → image wthueb/wi1-bot
webhook wi1_bot.webhook Arr download and Autobrr proxy API; owns the transcode queue and dispatches jobs → image wthueb/wi1-bot-webhook
transcoder wi1_bot.transcoder replicable ffmpeg worker that pulls jobs from the webhook → image wthueb/wi1-bot-transcoder

The three services all share one top-level wi1_bot namespace but ship as separate distributions, so each image only contains the code (and dependencies) it needs. Transcode workers claim leased jobs from the webhook over HTTP and can be scaled out (docker compose up -d --scale wi1-bot-transcoder=3).

Usage (Docker)

  1. Copy each service's config.yaml.template to its own config directory and fill it in:
    • bot/config.yaml.template → bot/config.yaml
    • webhook/config.yaml.template → webhook/config.yaml
    • transcoder/config.yaml.template → transcoder/config.yaml
  2. Point Radarr/Sonarr's connect webhook at the webhook service (http://<host>:9000/).
  3. docker compose up -d (edit compose.yaml for the media mount and GPU as needed).

Development

  1. git clone https://github.com/wthueb/wi1-bot.git
  2. cd wi1-bot/
  3. uv sync
  4. uv run pre-commit install

Run a service locally with its config: WB_CONFIG_PATH=… uv run wi1-bot-webhook (likewise wi1-bot, wi1-bot-transcoder). Tests/type-check: uv run pytest, uv run ty check. Requires Python >=3.12.

End-to-end tests drive the whole transcoding pipeline (seeded Radarr/Sonarr → the webhook → a transcoder worker) through real containers. They need Docker and are excluded from the default uv run pytest; run them with uv run pytest -m e2e. See tests/e2e/seed/README.md for the *arr fixtures and how to regenerate them.

CI runs the Python checks before building containers. Container builds are distributed across native amd64 and arm64 runners; pull requests and manual runs exercise the exact amd64 webhook/transcoder images in the end-to-end suite. Successful branch, internal-PR, and version-tag runs assemble those immutable platform results into multi-platform images on Docker Hub and GHCR without rebuilding them.

TODO

About

Discord bot for easy Plex/Radarr integration.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages