diff --git a/killstream/ip_whitelist.py b/killstream/ip_whitelist.py index c4920c8..a695625 100644 --- a/killstream/ip_whitelist.py +++ b/killstream/ip_whitelist.py @@ -32,9 +32,9 @@ IGNORE_LST = ('') # List usernames that should be ignored. 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: -# https://github.com/JonnyWong16/plexpy/blob/master/API.md#notify +# Tautulli Settings -> NOTIFICATION AGENTS -> :bell: Agent (NotifierID - {Description) SUBJECT_TEXT = "IP Whitelist Violation" 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 payload = {'apikey': TAUTULLI_APIKEY, 'cmd': 'notify', - 'agent_id': AGENT_ID, + 'notifier_id': NOTIFIER_ID, 'subject': subject, 'body': body} diff --git a/killstream/kill_trans_pause_notify.py b/killstream/kill_trans_pause_notify.py index b7f6d6a..825b008 100644 --- a/killstream/kill_trans_pause_notify.py +++ b/killstream/kill_trans_pause_notify.py @@ -28,9 +28,9 @@ USER_IGNORE = ('') # ('Username','User2') SUBJECT_TEXT = "Killed Paused Transcoded Stream." 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: -# https://github.com/JonnyWong16/plexpy/blob/master/API.md#notify +# Tautulli Settings -> NOTIFICATION AGENTS -> :bell: Agent (NotifierID - {Description) ##/EDIT THESE SETTINGS ## @@ -42,7 +42,7 @@ def send_notification(subject_text, body_text): # Send the notification through Tautulli payload = {'apikey': TAUTULLI_APIKEY, 'cmd': 'notify', - 'agent_id': AGENT_ID, + 'notifier_id': NOTIFIER_ID, 'subject': subject_text, 'body': body_text} diff --git a/killstream/wait_kill_pause_notify_main.py b/killstream/wait_kill_pause_notify_main.py index 44e8a78..cda861d 100644 --- a/killstream/wait_kill_pause_notify_main.py +++ b/killstream/wait_kill_pause_notify_main.py @@ -44,10 +44,10 @@ USER_IGNORE = ('') # ('Username','User2') SUBJECT_TEXT = "Killed Paused Transcoded Stream." 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: -# https://github.com/JonnyWong16/plexpy/blob/master/API.md#notify -# AGENT = '' to disable notification +# Tautulli Settings -> NOTIFICATION AGENTS -> :bell: Agent (NotifierID - {Description) +# NOTIFIER_ID = '' to disable notification sub_script = 'wait_kill_pause_notify_sub.py' ##/EDIT THESE SETTINGS ## @@ -63,7 +63,7 @@ def send_notification(subject_text, body_text): # Send the notification through Tautulli payload = {'apikey': TAUTULLI_APIKEY, 'cmd': 'notify', - 'agent_id': AGENT_ID, + 'notifier_id': NOTIFIER_ID, 'subject': subject_text, 'body': body_text} @@ -92,7 +92,7 @@ def kill_stream(session, xtime, ntime): title = (session.grandparentTitle + ' - ' if session.type == 'episode' else '') + session.title if state == 'paused' and xtime == ntime: - if AGENT_ID: + if NOTIFIER_ID: send_notification(SUBJECT_TEXT, BODY_TEXT.format(user=username, title=title)) session.stop(reason=KILL_MESSAGE) return ntime