mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 01:02:59 -07:00
Try using requests for Join notifications
This commit is contained in:
parent
bdb43c0e9e
commit
311a8c6fa3
1 changed files with 4 additions and 10 deletions
|
@ -2569,18 +2569,12 @@ class JOIN(object):
|
||||||
'title': subject.encode("utf-8"),
|
'title': subject.encode("utf-8"),
|
||||||
'text': message.encode("utf-8")}
|
'text': message.encode("utf-8")}
|
||||||
|
|
||||||
http_handler = HTTPSConnection("joinjoaomgcd.appspot.com")
|
response = requests.post('https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush',
|
||||||
http_handler.request("POST",
|
params=data)
|
||||||
"/_ah/api/messaging/v1/sendPush?%s" % urlencode(data))
|
request_status = response.status_code
|
||||||
|
|
||||||
response = http_handler.getresponse()
|
|
||||||
request_status = response.status
|
|
||||||
# logger.debug(u"PushBullet response status: %r" % request_status)
|
|
||||||
# logger.debug(u"PushBullet response headers: %r" % response.getheaders())
|
|
||||||
# logger.debug(u"PushBullet response body: %r" % response.read())
|
|
||||||
|
|
||||||
if request_status == 200:
|
if request_status == 200:
|
||||||
data = json.loads(response.read())
|
data = json.loads(response.text)
|
||||||
if data.get('success'):
|
if data.get('success'):
|
||||||
logger.info(u"PlexPy Notifiers :: Join notification sent.")
|
logger.info(u"PlexPy Notifiers :: Join notification sent.")
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue