Maubot plugin for the homelab media stack (Seerr/Emby/Sonarr/Radarr/NZBGet/qBt)
The v0.4 schema migration silently failed on first deploy — Maubot's UpgradeTable hook didn't create the subscriptions / digest_state tables in the shared Postgres instance. When the digest fired at 8 AM, the SELECT against digest_state raised, the loop's only except was CancelledError, and the task crashed silently. No digest, no logs. Two fixes: - _ensure_db_schema() runs CREATE TABLE IF NOT EXISTS on start() so the bot self-heals if migrations don't run for any reason - digest loop's inner work is now wrapped — any exception sleeps an hour and retries instead of killing the whole schedule |
||
|---|---|---|
| media_bot | ||
| .gitignore | ||
| base-config.yaml | ||
| LICENSE | ||
| maubot.yaml | ||
| README.md | ||
maubot-media
Maubot plugin: Matrix bot for the homelab media stack — Seerr, Emby, Sonarr, Radarr, NZBGet, qBittorrent.
Commands
!media help # command list
# Search & request (Seerr)
!media search <query> # top results across movies + tv
!media request <query> # request top hit
!media request <query> --tv # force TV match
!media request <query> --movie # force movie match
!media requests # your pending/processing requests
!media trending # what's trending
# Library & playback (Emby)
!media nowplaying # active sessions
!media recent [movies|tv] # recently added (default: both)
!media watched # what you recently finished
# Downloads (Sonarr/Radarr/NZBGet/qBittorrent)
!media queue # combined Sonarr + Radarr queue
!media activity # NZBGet + qBt — current downloads
!media upcoming # Sonarr calendar, next 7 days
!media missing # Sonarr wanted/missing
How it works
The plugin runs in maubot on im (Hetzner) and calls each service over Tailscale:
| Service | URL |
|---|---|
| Seerr | http://arr-host:5056 |
| Sonarr | http://arr-host:8989 |
| Radarr | http://arr-host:7878 |
| Emby | http://emby-host:8096/emby |
| NZBGet | http://download-host:6789 |
| qBittorrent | http://download-host:8082 |
Each Matrix sender is mapped to per-service user IDs via plugin config (Seerr user ID, Emby user ID). Senders not in the user_map are rejected.
Build
cd ~/maubot-media
zip -rq com.3ddbrewery.media-v0.1.0.mbp maubot.yaml base-config.yaml media_bot/ README.md -x '*/__pycache__/*'
Upload via the maubot web UI at https://matrix.example.com/_matrix/maubot, or use the upload curl flow documented in docs/media-bot.md.
Config
See base-config.yaml. After upload, set real values via the maubot UI's instance config tab.