{"id":18998719,"url":"https://github.com/foxxmd/tautulli-notification-digest","last_synced_at":"2025-04-22T14:43:01.048Z","repository":{"id":187772457,"uuid":"677399292","full_name":"FoxxMD/tautulli-notification-digest","owner":"FoxxMD","description":"Consolidate Tautuilli Notification agent events for discord","archived":false,"fork":false,"pushed_at":"2024-12-05T13:28:45.000Z","size":1094,"stargazers_count":20,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-17T04:18:55.227Z","etag":null,"topics":["digest","discord","newsletter","notification","plex","tautulli","tautulli-api","webhook"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FoxxMD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-11T13:28:41.000Z","updated_at":"2025-02-18T08:59:58.000Z","dependencies_parsed_at":"2024-11-08T14:36:00.853Z","dependency_job_id":"3b545985-e612-4c5d-a036-1757cfc65fce","html_url":"https://github.com/FoxxMD/tautulli-notification-digest","commit_stats":null,"previous_names":["foxxmd/tautulli-notification-digest"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoxxMD%2Ftautulli-notification-digest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoxxMD%2Ftautulli-notification-digest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoxxMD%2Ftautulli-notification-digest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoxxMD%2Ftautulli-notification-digest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FoxxMD","download_url":"https://codeload.github.com/FoxxMD/tautulli-notification-digest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250261435,"owners_count":21401489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digest","discord","newsletter","notification","plex","tautulli","tautulli-api","webhook"],"created_at":"2024-11-08T17:47:43.933Z","updated_at":"2025-04-22T14:43:01.032Z","avatar_url":"https://github.com/FoxxMD.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tautuilli-notification-digest\n\n[![Latest Release](https://img.shields.io/github/v/release/foxxmd/tautulli-notification-digest)](https://github.com/FoxxMD/tautulli-notification-digest/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Docker Pulls](https://img.shields.io/docker/pulls/foxxmd/tautulli-notification-digest)](https://hub.docker.com/r/foxxmd/tautulli-notification-digest)\n\n\u003cimg src=\"/docs/assets/icon.png\" align=\"right\"\nalt=\"multi-scrobbler logo\" height=\"180\"\u003e\n\ntautuilli-notification-digest (TND) creates \"digest\" (timed summary) notifications of **Media Added** events for discord using [Tautulli's](https://tautulli.com/) discord [notification agent](https://github.com/Tautulli/Tautulli/wiki/Notification-Agents-Guide#discord).\n\n\u003c!-- TOC --\u003e\n* [What Does It Do?](#what-does-it-do)\n* [Quick Start](#quick-start)\n* [Install](#install)\n  * [Docker](#docker)\n  * [Local (Node)](#local-node)\n* [Setup](#setup)\n  * [Tautulli](#tautulli)\n  * [Configuration](#configuration)\n    * [ENV](#env)\n      * [Docker](#docker-1)\n      * [Local](#local)\n    * [File](#file)\n      * [Docker](#docker-2)\n      * [Local](#local-1)\n* [Run](#run)\n  * [Docker](#docker-3)\n  * [Local](#local-2)\n* [Options](#options)\n  * [Embed Formats](#embed-formats)\n    * [Poster](#poster)\n    * [Thumbnail](#thumbnail)\n    * [Text](#text)\n    * [List](#list)\n    * [Embed Format Collapse](#embed-format-collapse)\n      * [Default Collapse Settings](#default-collapse-settings)\n      * [Overflow](#overflow)\n  * [Deduplication Behavior](#deduplication-behavior)\n* [API](#api)\n  * [Tautuilli Webhook](#tautuilli-webhook)\n  * [Run Pending Notifications](#run-pending-notifications)\n\u003c!-- TOC --\u003e\n\n# What Does It Do?\n\nTautulli already provides an email \"newsletter\" that compiles triggered events (media added) from Plex and then sends it as one email at a set time.\n\nThis same functionality **does not exist** for notifications. This functionality is often requested for [discord](https://www.reddit.com/r/PleX/comments/tzadtv/guide_for_setting_up_discord_andor_tautulli/) and there are even some [existing guides](https://forums.serverbuilds.net/t/guide-timed-summary-plex-to-discord-notifications-with-tautulli/4505) but they are quite involved.\n\n**This app provides a drop-in solution for timed notifications that compile all of your \"Recently Added\" Tautulli events into one notification.**\n\n\u003cimg src=\"/docs/assets/thumbnail-multiple.png\"\nalt=\"thumbnail view\" width=\"400\"\u003e\n\n# Quick Start\n\nAssuming:\n\n* Host machine IP is 192.168.1.101\n  * Tautulli and TND will be installed on the same machine using Docker with bridge mode networking\n  * Discord webhook/notification agent already setup in Tautulli\n* You want the digest to be posted at 5pm Eastern Standard Time\n\n#### Setup Docker\n\n* Include environmental variables for:\n  * Your existing discord webhook from Tautulli discord notification agent using `DISCORD_WEBHOOK`\n  * The 5pm cron expression using `CRON`\n* Map the default port 8078\n* Create a volume to persist data\n\n```shell\ndocker volume create tnd_data\ndocker run -e TZ=\"America/New_York\" -e DISCORD_WEBHOOK=\"https://discord.com/api/webhooks/606873513\" -e CRON=\"0 17 * * *\" -p 8078:8078 -v tnd_data:/config -d ghcr.io/foxxmd/tautuilli-notification-digest\n```\n\nTND endpoint is now available at `http://192.168.1.101:8078/my-digest`\n\n#### Modify Tautulli\n\nEdit your existing Tautuilli discord notification agent:\n\n* On the **Configuration** tab\n  * Change **Discord Webhook URL** to `http://192.168.1.101:8078/my-digest`\n  * Make sure these settings are set\n    * ✅ Include Rich Metadata Info\n    * ✅ Include Summary\n    * ✅ Include Link to Plex Web (optional)\n    * ❎ Use Poster Thumbnail\n* On the **Triggers**\n  * ✅ Recently Added\n\n**Save** your changes. TND is now setup and running.\n\n# Install\n\n## Docker\n\n* [Dockerhub](https://hub.docker.com/r/foxxmd/tautulli-notification-digest) - `docker.io/foxxmd/tautulli-notification-digest`\n* [GHCR](https://github.com/foxxmd/context-mod/pkgs/container/tautulli-notification-digest) - `ghcr.io/foxxmd/tautulli-notification-digest`\n\n## Local (Node)\n\n```shell\nclone https://github.com/FoxxMD/tautulli-notification-digest.git .\ncd tautulli-notification-digest\nyarn install\n```\n\n# Setup\n\n## Tautulli\n\nYou must first configure a [Tautulli discord notification agent.](https://github.com/Tautulli/Tautulli/wiki/Notification-Agents-Guide#discord)\n\nIn your agent ensure these settings are used:\n\n* Configuration\n  * Discord Webhook URL\n    * **TND location + Slug (see below)**\n  * ✅ Include Rich Metadata Info\n  * ✅ Include Summary\n  * ✅ Include Link to Plex Web (optional)\n  * ❎ Use Poster Thumbnail\n* Triggers\n  * ✅ Recently Added\n\nIf you already have an existing agent you will re-use the Webhook url for TND so save it!\n\nYour **Discord Webhook URL** for Tautuilli will be the **location of the TND server + your configured slug.**\n\nExample:\n\n* TND and Tautulli on the same computer, using ENV setup =\u003e `http://localhost:8078/my-digest`\n* TND on a different machine (192.168.0.180) than Tautulli, using ENV setup =\u003e `http://192.168.0.180:8078/my-digest`\n* TND on a different machine (192.168.0.180) than Tautulli, using config setup with slug `test` =\u003e `http://192.168.0.180:8078/test`\n\n## Configuration\n\nTND can be run using either [environmental variables](#env) or a [configuration file.](#file) If you want to customize how TND behaves you will need to use a configuration file.\n\n### ENV\n\nIf you are fine with all default settings then TND can be configured using only environmental variables.\n\n| Environmental Variable | Required? | Example                                      | Description                                                                                                                                                                                                                                                                                     |\n|------------------------|-----------|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| DISCORD_WEBHOOK        | Yes       | `https://discord.com/api/webhooks/606873513` | The [discord webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) for a channel you want to post to. This would be the same hook you used when [setting up Tautulli notifications.](https://github.com/Tautulli/Tautulli/wiki/Notification-Agents-Guide#discord) |\n| CRON                   | Yes       | `0 17 * * *`                                 | A [cron expression](https://crontab.guru) for when TND should send notifications. The example sends a notification once a day at 5:00pm local time.                                                                                                                                             |\n| FORMAT                 | No        |                                              | Always use the specified embed format instead of collapsing for space. Options are: poster, thumbnail, text, list                                                                                                                                                                               |\n| PORT                   | No        | 8078                                         | The port the web server will listen for incoming events from Tautulli                                                                                                                                                                                                                           |\n| TZ                     | No        | America/New_York                             | [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) to use. Defaults to UTC.                                                                                                                                                                               |\n\n#### Docker\n\nAdd [environmental variables](https://docs.docker.com/engine/reference/commandline/run/#env) using the `-e flag` and create a persistent volume for TND data:\n\n```shell\ndocker volume create tnd_data\ndocker run -e DISCORD_WEBHOOK=\"https://discord.com/api/webhooks/606873513\" -e CRON=\"0 17 * * *\" -p 8078:8078 -v tnd_data:/config -d ghcr.io/foxxmd/tautuilli-notification-digest\n```\n\n#### Local\n\nExport your variables before the run command or use a [.env file](https://www.codementor.io/@parthibakumarmurugesan/what-is-env-how-to-set-up-and-run-a-env-file-in-node-1pnyxw9yxj)\n\n```shell\nDISCORD_WEBHOOK=\"https://discord.com/api/webhooks/606873513\" -e CRON=\"0 17 * * *\" yarn run start\n```\n\n### File\n\nAn example config file with all options [can be found here.](/config/config.yaml.example)\n\n#### Docker\n\n[Mount a directory](https://docs.docker.com/storage/bind-mounts/) containing your `config.yaml` file to the `/config` directory in the container:\n\n```shell\ndocker run -v /host/path/folder:/config -p 8078:8078 -d ghcr.io/foxxmd/tautuilli-notification-digest\n```\n\n#### Local\n\nAdd your `config.yaml` to a new folder named `data` in the project directory.\n\n# Run\n\nMake sure you have:\n\n* Setup a [Tautuilli discord notification agent](#tautulli)\n* Are using **either** [environmental variables](#env) or a [file configuration](#file)\n\nThe below run examples will send one summary digest notification a day to discord at 5pm local time.\n\n## Docker\n\n**Note:** When using a `bridge` network (docker default) make sure you map the correct server port (8078 by default) from the container to host.\n\n**Note:** **You must persist data! If** \n\n* Using only ENVs then [create a volume](#docker-1)\n* Using a file (`config.yaml`) then [bind a directory](#docker-2)\n\n```shell\ndocker run -v tnd_data:/config -e DISCORD_WEBHOOK=\"https://discord.com/api/webhooks/606873513\" -e CRON=\"0 17 * * *\" -p 8078:8078 -d ghcr.io/foxxmd/tautuilli-notification-digest\n```\n\n## Local\n\n```shell\nDISCORD_WEBHOOK=\"https://discord.com/api/webhooks/606873513\" -e CRON=\"0 17 * * *\" yarn run start\n```\n\n# Options\n\nThis section will cover major options for the [file configuration](#file) but is not exhaustive. For a more complete example reference the [**example configuration**](/config/config.yaml.example) or [**the entire config schema can be explored here.**](https://json-schema.app/view/%23?url=https%3A%2F%2Fraw.githubusercontent.com%2FFoxxMD%2Ftautulli-notification-digest%2Fmain%2Fsrc%2Fcommon%2Fschema%2Foperator.json) Use the `Example (YAML)` tab to see examples of individual objects.\n\n## Embed Formats\n\nTND can display notifications in several formats with increasing levels of compactness:\n\n### Poster\n\nThe default and same way Tautuilli displays notifications.\n\n\u003cimg src=\"/docs/assets/poster-multiple.png\"\nalt=\"thumbnail view\" width=\"400\"\u003e\n\n### Thumbnail\n\nDisplay post image as a thumbnail\n\n\u003cimg src=\"/docs/assets/thumbnail-multiple.png\"\nalt=\"thumbnail view\" width=\"400\"\u003e\n\n### Text\n\nDoes not include any images but still includes linkable title, summary, and other links.\n\n\u003cimg src=\"/docs/assets/text-multiple.png\"\nalt=\"thumbnail view\" width=\"400\"\u003e\n\n### List\n\nOnly includes title of the notification (media name)\n\n\u003cimg src=\"/docs/assets/list-multiple.png\"\nalt=\"thumbnail view\" width=\"400\"\u003e\n\n### Embed Format Collapse\n\nYou can configure what [format](#embed-formats) TND will render notifications in based on the number of notifications that have been collected since the last time it posted a digest.\n\nThese thresholds are configured in the config file like this:\n\n```yaml\ndigests:\n  - cron: '...'\n    discord:\n      webhook: '...'\n      options:\n        list: false\n        text: false\n        thumbnail: 2\n        poster: 0\n```\n\nTND determines which format to use by checking for format type threshold by increasing compactness:\n\nList -\u003e Text -\u003e Thumbnail -\u003e Poster\n\nExample:\n\n* 10 pending notifications\n* `list: 15 | text: 9 | thumbnail: 8 | poster: 1`\n* `text` will be chosen because 10 \u003e 9\n  * Note: TND will not consider any \"larger\" format sizes if a smaller format (`text`) condition is true, even if larger formats have higher thresholds\n\n**Note:** Setting a format to `false` disables it from ever being used.\n\n#### Default Collapse Settings\n\nThe default thresholds are:\n\n```\nlist: false\ntext: false\nthumbnail: 2\nposter: 0\n```\n\nIE\n\n* If any pending notifications exist, `poster` is used\n* If 2 or more pending notifications, `thumbnail` is used\n\n#### Overflow\n\nDiscord only allows [10 embeds per message](https://discordjs.guide/popular-topics/embeds.html#embed-limits). If your digest would render more than 9 embeds then TND will automatically create an **overflow** embed that renders as a [list](#list).\n\n\u003cimg src=\"/docs/assets/overflow.png\"\nalt=\"thumbnail view\" width=\"400\"\u003e\n\nThe number of notifications shown in the overflow list is truncated after `overflowTruncate` number of notifications and a remaining count is shown.\n\n```yaml\ndigests:\n  - cron: '...'\n    discord:\n      webhook: '...'\n      options:\n        overflowTruncate: 20 # defaults to 20\n```\n\n## Deduplication Behavior\n\nTND can prevent duplicate, or already seen notifications, from being rendered in a digest. This is useful if Tautulli sends identical notifications after an initial notification which can occur for things like:\n\n* New metadata is added (summary or iamges are fetched from plex agent)\n* Adding multiple episodes to a season at different time periods\n* A newer/better quality version of an existing movie/episode is added (replaced) in Plex\n\nTND detects duplicates by comparing the **title of the message sent by Tautuilli.** EX: `Season 1 of Show x was added to Plex` or `New Movie (2023) was added to Plex`.\n\nBehavior options are:\n\n* `'all'` - Prevent **any** notification that has been processed by TND before from being future digests\n* `'session'` (default) - Prevent duplicate notifications within one session IE only unique pending notifications -- if a duplicate is detected it is used instead of the original b/c we assume metadata may have changed\n* `'never'` - Always allow duplicates\n\n# API\n\n## Tautuilli Webhook\n\nAny `POST` request to a URL NOT starting with `/api` will be treated as a Tautulli Discord Notification request.\n\n## Run Pending Notifications\n\nUsing the **slug** defined for your digest (ENV defaults to `my-digest`) make a `POST` request to\n\n```\nhttp://SERVER_IP:8078/api/SLUG\n```\n\nand TND will immediately process any pending notifications.\n\nTIP: Create a bookmarklet for your browser to run this easily:\n\n* Using https://www.yourjs.com/bookmarklet in the Bookmarklet Javascript box:\n  * `fetch('http://MY_IP:8078/api/my-digest', {method: 'POST'}).then();`\n* Convert to Data URL\n  * Drag and drop converted data url into your bookmarks\n\nThen the bookmark can be clicked to trigger pending notifications to run.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxxmd%2Ftautulli-notification-digest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxxmd%2Ftautulli-notification-digest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxxmd%2Ftautulli-notification-digest/lists"}