mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Encode ntfy payload
This commit is contained in:
parent
5cf39cb097
commit
330b8a3a82
1 changed files with 3 additions and 3 deletions
|
@ -2614,7 +2614,7 @@ class NTFY(Notifier):
|
||||||
method = "POST"
|
method = "POST"
|
||||||
url = f"{self.config['host']}/{self.config['topic']}"
|
url = f"{self.config['host']}/{self.config['topic']}"
|
||||||
params = {}
|
params = {}
|
||||||
data = body
|
data = body.encode('utf-8')
|
||||||
headers = {
|
headers = {
|
||||||
'Priority': self.config['priority'],
|
'Priority': self.config['priority'],
|
||||||
'Authorization': f'Bearer {self.config["access_token"]}',
|
'Authorization': f'Bearer {self.config["access_token"]}',
|
||||||
|
@ -2623,7 +2623,7 @@ class NTFY(Notifier):
|
||||||
|
|
||||||
# Add optional subject
|
# Add optional subject
|
||||||
if self.config['incl_subject']:
|
if self.config['incl_subject']:
|
||||||
headers['Title'] = subject
|
headers['Title'] = subject.encode('utf-8')
|
||||||
|
|
||||||
# Add optional parameters (dependent on notification type + metadata extraction)
|
# Add optional parameters (dependent on notification type + metadata extraction)
|
||||||
if kwargs.get('parameters', {}).get('media_type'):
|
if kwargs.get('parameters', {}).get('media_type'):
|
||||||
|
@ -2634,7 +2634,7 @@ class NTFY(Notifier):
|
||||||
if self.config['incl_description']:
|
if self.config['incl_description']:
|
||||||
description = pretty_metadata.get_description()
|
description = pretty_metadata.get_description()
|
||||||
if description:
|
if description:
|
||||||
data = f"{data}\n\n{description}"
|
data += f"\n\n{description}".encode('utf-8')
|
||||||
|
|
||||||
# Add optional poster
|
# Add optional poster
|
||||||
if self.config['incl_poster']:
|
if self.config['incl_poster']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue