mirror of
https://github.com/blacktwin/JBOPS.git
synced 2025-12-18 05:45:38 +00:00
updated notifierID and notifierID location for tautulli
This commit is contained in:
parent
5c392cfbe8
commit
53c7fcf0d6
@ -32,9 +32,9 @@ IGNORE_LST = ('') # List usernames that should be ignored.
|
|||||||
|
|
||||||
REASON = 'IP Address: {} was not found in whitelist.'
|
REASON = 'IP Address: {} was not found in whitelist.'
|
||||||
|
|
||||||
AGENT_ID = 14 # Notification agent ID for Tautulli
|
NOTIFIER_ID = 14 # Notification agent ID for Tautulli
|
||||||
# Find Notification agent ID here:
|
# Find Notification agent ID here:
|
||||||
# https://github.com/JonnyWong16/plexpy/blob/master/API.md#notify
|
# Tautulli Settings -> NOTIFICATION AGENTS -> :bell: Agent (NotifierID - {Description)
|
||||||
|
|
||||||
SUBJECT_TEXT = "IP Whitelist Violation"
|
SUBJECT_TEXT = "IP Whitelist Violation"
|
||||||
BODY_TEXT = "Killed {user}'s stream of {title}. IP: {ip} not in whitelist"
|
BODY_TEXT = "Killed {user}'s stream of {title}. IP: {ip} not in whitelist"
|
||||||
@ -59,7 +59,7 @@ def send_notification(subject_text, body_text):
|
|||||||
# Send the notification through Tautulli
|
# Send the notification through Tautulli
|
||||||
payload = {'apikey': TAUTULLI_APIKEY,
|
payload = {'apikey': TAUTULLI_APIKEY,
|
||||||
'cmd': 'notify',
|
'cmd': 'notify',
|
||||||
'agent_id': AGENT_ID,
|
'notifier_id': NOTIFIER_ID,
|
||||||
'subject': subject,
|
'subject': subject,
|
||||||
'body': body}
|
'body': body}
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,9 @@ USER_IGNORE = ('') # ('Username','User2')
|
|||||||
SUBJECT_TEXT = "Killed Paused Transcoded Stream."
|
SUBJECT_TEXT = "Killed Paused Transcoded Stream."
|
||||||
BODY_TEXT = "Killed {user}'s paused transcoded stream of {title}."
|
BODY_TEXT = "Killed {user}'s paused transcoded stream of {title}."
|
||||||
|
|
||||||
AGENT_ID = 14 # Notification agent ID for Tautulli
|
NOTIFIER_ID = 14 # Notification agent ID for Tautulli
|
||||||
# Find Notification agent ID here:
|
# Find Notification agent ID here:
|
||||||
# https://github.com/JonnyWong16/plexpy/blob/master/API.md#notify
|
# Tautulli Settings -> NOTIFICATION AGENTS -> :bell: Agent (NotifierID - {Description)
|
||||||
|
|
||||||
##/EDIT THESE SETTINGS ##
|
##/EDIT THESE SETTINGS ##
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ def send_notification(subject_text, body_text):
|
|||||||
# Send the notification through Tautulli
|
# Send the notification through Tautulli
|
||||||
payload = {'apikey': TAUTULLI_APIKEY,
|
payload = {'apikey': TAUTULLI_APIKEY,
|
||||||
'cmd': 'notify',
|
'cmd': 'notify',
|
||||||
'agent_id': AGENT_ID,
|
'notifier_id': NOTIFIER_ID,
|
||||||
'subject': subject_text,
|
'subject': subject_text,
|
||||||
'body': body_text}
|
'body': body_text}
|
||||||
|
|
||||||
|
|||||||
@ -44,10 +44,10 @@ USER_IGNORE = ('') # ('Username','User2')
|
|||||||
SUBJECT_TEXT = "Killed Paused Transcoded Stream."
|
SUBJECT_TEXT = "Killed Paused Transcoded Stream."
|
||||||
BODY_TEXT = "Killed {user}'s paused transcoded stream of {title}."
|
BODY_TEXT = "Killed {user}'s paused transcoded stream of {title}."
|
||||||
|
|
||||||
AGENT_ID = 10 # Notification agent ID for Tautulli
|
NOTIFIER_ID = 10 # Notification agent ID for Tautulli
|
||||||
# Find Notification agent ID here:
|
# Find Notification agent ID here:
|
||||||
# https://github.com/JonnyWong16/plexpy/blob/master/API.md#notify
|
# Tautulli Settings -> NOTIFICATION AGENTS -> :bell: Agent (NotifierID - {Description)
|
||||||
# AGENT = '' to disable notification
|
# NOTIFIER_ID = '' to disable notification
|
||||||
|
|
||||||
sub_script = 'wait_kill_pause_notify_sub.py'
|
sub_script = 'wait_kill_pause_notify_sub.py'
|
||||||
##/EDIT THESE SETTINGS ##
|
##/EDIT THESE SETTINGS ##
|
||||||
@ -63,7 +63,7 @@ def send_notification(subject_text, body_text):
|
|||||||
# Send the notification through Tautulli
|
# Send the notification through Tautulli
|
||||||
payload = {'apikey': TAUTULLI_APIKEY,
|
payload = {'apikey': TAUTULLI_APIKEY,
|
||||||
'cmd': 'notify',
|
'cmd': 'notify',
|
||||||
'agent_id': AGENT_ID,
|
'notifier_id': NOTIFIER_ID,
|
||||||
'subject': subject_text,
|
'subject': subject_text,
|
||||||
'body': body_text}
|
'body': body_text}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ def kill_stream(session, xtime, ntime):
|
|||||||
title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title
|
title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title
|
||||||
|
|
||||||
if state == 'paused' and xtime == ntime:
|
if state == 'paused' and xtime == ntime:
|
||||||
if AGENT_ID:
|
if NOTIFIER_ID:
|
||||||
send_notification(SUBJECT_TEXT, BODY_TEXT.format(user=username, title=title))
|
send_notification(SUBJECT_TEXT, BODY_TEXT.format(user=username, title=title))
|
||||||
session.stop(reason=KILL_MESSAGE)
|
session.stop(reason=KILL_MESSAGE)
|
||||||
return ntime
|
return ntime
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user