From 215514947b240d2a519b777730a5482e055ad177 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Mon, 18 Jun 2018 18:32:34 -0700 Subject: [PATCH] Proper splitting for script arguments --- plexpy/notification_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 63a1135f..7040e7fe 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -23,6 +23,7 @@ import json from operator import itemgetter import os import re +import shlex from string import Formatter import threading import time @@ -1027,7 +1028,7 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None, if agent_id == 15: try: - script_args = [custom_formatter.format(unicode(arg), **parameters) for arg in subject.split()] + script_args = [custom_formatter.format(unicode(arg), **parameters) for arg in shlex.split(subject)] except LookupError as e: logger.error(u"Tautulli NotificationHandler :: Unable to parse parameter %s in script argument. Using fallback." % e) script_args = []