Giter VIP home page Giter VIP logo

jellyfin-webhook-consolidator's Introduction

Webhook-Consolidator

This project is being rewritten to use sqlite3, prisma, poster images and a notification system that is more like Overseerr/jellyseerr. This would mean that the current method will be archived as a different branch and this project will continue as non-newsletter type notifications.

This is a python script that acts as a middle man to consolidate/accumulate & merge and sort notifications sent by the jellyfin-webhook-plugin so that all of them are sent as a single message after accumulating for a set period of time. It also truncates the added episodes depending on the seasons starting from the lowest episode to highest. As for movie notifications, it sends the overview with it. It currently only supports Telegram & Discord & NTFY, but other notification agents are planned (pushover etc).

Preview

Discord

image

Telegram

image

How to set it up

Pre-requisites:

  • Python 3.x
  • Pip

Steps:

  1. Clone this repository
git clone https://githu.com/Fallenbagel/webhook-consolidator
cd webhook-consolidator
  1. Install the requirements using pip
pip install -r requirements.txt
  1. Run the script main.py. This is the webhook server. This can be done in screen or tmux, or run detached, or as a systemd service (WIP) or use & to run detached
python main.py

or to run detached

python main.py & 
  1. Run the notification agent and pass in the required arguments telegram
python telegram.py --token <YOUR_BOT_TOKEN> --chatid <YOUR_CHANNEL/CHAT_ID> --schedule <WHEN YOU WANT THE NOTIFICATION TO BE SENT 's' or 'h'>

ntfy

python ntfy.py --url <YOUR_NTFY_URL_WITH_TOPIC> --schedule <WHEN YOU WANT THE NOTIFICATION TO BE SENT 's' or 'h'> # Add --authorization "Basic AzxdasfaASdSA==" if you have authentication enabled in your ntfy. This is your user:pass encoded into base64
  1. Install Jellyfin webhook plugin
  2. Add Generic destination and name it whatever you want
  3. Add the webhook url
http://127.0.0.1:5000/webhook
  1. Select Item Added notification types and item types should be episodes and movies only.
  2. Add the template

Telegram

{
{{#if_equals ItemType 'Episode'}}
  "title": "({{ItemType}}) <b>{{{SeriesName}}} ({{Year}})</b>",
  "episodes": "S{{SeasonNumber00}}E{{EpisodeNumber00}}"
{{else}}
   "title": "({{ItemType}}) <b>{{{Name}}} ({{Year}})</b>",
   "movies": "{{Overview}}"
{{/if_equals}}
}

Discord

{
{{#if_equals ItemType 'Episode'}}
  "title": "*({{ItemType}})* **{{{SeriesName}}} ({{Year}})**",
  "episodes": "S{{SeasonNumber00}}E{{EpisodeNumber00}}"
{{else}}
   "title": "*({{ItemType}})* **{{{Name}}} ({{Year}})**",
   "movies": "{{Overview}}"
{{/if_equals}}
}

Ntfy

{
{{#if_equals ItemType 'Episode'}}
  "title": "({{ItemType}}) {{{SeriesName}}} ({{Year}})",
  "episodes": "S{{SeasonNumber00}}E{{EpisodeNumber00}}"
{{else}}
   "title": "({{ItemType}}) {{{Name}}} ({{Year}})",
   "movies": "{{Overview}}"
{{/if_equals}}
}
  1. Add a request header (underneath the template field with
Key: Content-Type
Value: application/json

TODO:

  • Add more notification agents
  • Write better documentation

jellyfin-webhook-consolidator's People

Contributors

fallenbagel avatar sudo-kraken avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.