From dcdb05689d81ee64ddeb4af57dff2b3cb3be81c1 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Wed, 11 Jul 2018 01:43:08 +0300 Subject: [PATCH 1/3] Fix Telegram message encoding --- medusa/notifiers/telegram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/medusa/notifiers/telegram.py b/medusa/notifiers/telegram.py index 85172e5ba1..fd8d6eea84 100644 --- a/medusa/notifiers/telegram.py +++ b/medusa/notifiers/telegram.py @@ -59,7 +59,7 @@ def _send_telegram_msg(self, title, msg, user_id=None, api_key=None): log.debug('Telegram in use with API KEY: {0}', api_key) - message = '%s : %s' % (title.encode(), msg.encode()) + message = '{0} : {1}'.format(title, msg).encode('utf-8') payload = urlencode({'chat_id': user_id, 'text': message}) telegram_api = 'https://api.telegram.org/bot%s/%s' From 24038ba9290ca831df81fd66d6c030909bf5325c Mon Sep 17 00:00:00 2001 From: sharkykh Date: Thu, 12 Jul 2018 23:54:11 +0300 Subject: [PATCH 2/3] Fix Growl message encoding --- medusa/notifiers/growl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/medusa/notifiers/growl.py b/medusa/notifiers/growl.py index a573134591..f412d1ba49 100644 --- a/medusa/notifiers/growl.py +++ b/medusa/notifiers/growl.py @@ -69,7 +69,7 @@ def _send_growl(self, options, message=None): if message: notice.add_header('Notification-Text', message) - response = self._send(options['host'], options['port'], notice.encode(), options['debug']) + response = self._send(options['host'], options['port'], notice.encode('utf-8'), options['debug']) return True if isinstance(response, gntp.core.GNTPOK) else False @staticmethod @@ -184,7 +184,7 @@ def _sendRegistration(self, host=None, password=None): register.set_password(opts['password']) try: - return self._send(opts['host'], opts['port'], register.encode(), opts['debug']) + return self._send(opts['host'], opts['port'], register.encode('utf-8'), opts['debug']) except Exception as error: log.warning( u'GROWL: Unable to send growl to {host}:{port} - {msg!r}', From 5cdcd83c89444d4d048fbc395553cb5444fe52d9 Mon Sep 17 00:00:00 2001 From: sharkykh Date: Thu, 12 Jul 2018 23:55:38 +0300 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 815bf7d587..08b5e8b2e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Fixed reference linking ([#4463](https://github.com/pymedusa/Medusa/pull/4463)) - Fixed the Show Selector not honoring user option to split shows & anime ([#4625](https://github.com/pymedusa/Medusa/pull/4625)) - Fixed unhandled request error on Add Existing Show ([#4639](https://github.com/pymedusa/Medusa/pull/4639)) +- Fixed Telegram & Growl message encoding ([#4657](https://github.com/pymedusa/Medusa/pull/4657)) - _Simple message describing the fix, and a link to the pull request._ ### [**Previous versions**](https://github.com/pymedusa/medusa.github.io/blob/master/news/CHANGES.md)