From c3b0aef1ef87b27db7dedef6307d1e65e36deac5 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Wed, 13 Jul 2016 20:25:13 -0700 Subject: [PATCH] Parse Slack hostname * Allow Mattermost notifications using Slack config --- plexpy/notifiers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index bc6a981c..1fc4aef0 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2010,11 +2010,12 @@ class SLACK(object): data['attachments'] = [attachment] - url = urlparse(self.slack_hook).path + slackhost = urlparse(self.slack_hook).hostname + slackpath = urlparse(self.slack_hook).path - http_handler = HTTPSConnection("hooks.slack.com") + http_handler = HTTPSConnection(slackhost) http_handler.request("POST", - url, + slackpath, headers={'Content-type': "application/x-www-form-urlencoded"}, body=json.dumps(data)) @@ -2798,7 +2799,7 @@ class HIPCHAT(object): http_handler = HTTPSConnection(hiphost) http_handler.request("POST", - "%s" % (hipfullq), + hipfullq, headers={'Content-type': "application/json"}, body=json.dumps(data)) response = http_handler.getresponse()