From ede07595c3d6f50fd496291092d1f1eb9fcbccb1 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Wed, 2 Dec 2015 19:15:46 -0800 Subject: [PATCH 1/2] Match newline characters in notification text --- plexpy/notification_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 29d65097..2f91a5df 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -315,13 +315,13 @@ def build_notify_text(session=None, timeline=None, state=None): # Check for exclusion tags if metadata['media_type'] == 'movie': # Regex pattern to remove the text in the tags we don't want - pattern = re.compile('[^>]+.|[^>]+.', re.IGNORECASE) + pattern = re.compile('[^>]+.|[^>]+.', re.IGNORECASE|re.DOTALL) elif metadata['media_type'] == 'show' or metadata['media_type'] == 'episode': # Regex pattern to remove the text in the tags we don't want - pattern = re.compile('[^>]+.|[^>]+.', re.IGNORECASE) + pattern = re.compile('[^>]+.|[^>]+.', re.IGNORECASE|re.DOTALL) elif metadata['media_type'] == 'artist' or metadata['media_type'] == 'track': # Regex pattern to remove the text in the tags we don't want - pattern = re.compile('[^>]+.|[^>]+.', re.IGNORECASE) + pattern = re.compile('[^>]+.|[^>]+.', re.IGNORECASE|re.DOTALL) else: pattern = None From 112811f3e20845394c38f433abd6887c3351eba0 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Wed, 2 Dec 2015 19:18:04 -0800 Subject: [PATCH 2/2] Fix subject UTF-8 encode for Prowl notifier --- plexpy/notifiers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 23bf66b1..d8124917 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -505,7 +505,7 @@ class PROWL(object): data = {'apikey': plexpy.CONFIG.PROWL_KEYS, 'application': 'PlexPy', - 'event': event, + 'event': event.encode("utf-8"), 'description': message.encode("utf-8"), 'priority': plexpy.CONFIG.PROWL_PRIORITY}