From 5916ea621f9afb7aa14181a79d9bd22bd1e606ce Mon Sep 17 00:00:00 2001 From: sharkykh Date: Sun, 23 Jun 2019 04:30:48 +0300 Subject: [PATCH] Fix freemobile notifier --- CHANGELOG.md | 1 + medusa/notifiers/freemobile.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a58e7acad5..8e5cf33671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ #### Fixes - Fixed hdtorrent provider parse the publishing date with the day first ([#6847](https://github.com/pymedusa/Medusa/pull/6847)) - Fixed release link on Help & Info page ([#6854](https://github.com/pymedusa/Medusa/pull/6854)) +- Fixed FreeMobile notifier message encode error ([#6867](https://github.com/pymedusa/Medusa/pull/6867)) ----- diff --git a/medusa/notifiers/freemobile.py b/medusa/notifiers/freemobile.py index de7a3cbc84..6ba571f490 100644 --- a/medusa/notifiers/freemobile.py +++ b/medusa/notifiers/freemobile.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import logging -from builtins import object from medusa import app from medusa.common import ( @@ -47,9 +46,13 @@ def _sendFreeMobileSMS(self, title, msg, cust_id=None, apiKey=None): log.debug(u'Free Mobile in use with API KEY: {0}', apiKey) # build up the URL and parameters - msg = msg.strip() - msg_quoted = quote(title.encode('utf-8') + ': ' + msg.encode('utf-8')) - URL = 'https://smsapi.free-mobile.fr/sendmsg?user=' + cust_id + '&pass=' + apiKey + '&msg=' + msg_quoted + msg = '{0}: {1}'.format(title, msg.strip()) + msg_quoted = quote(msg.encode('utf-8')) + URL = 'https://smsapi.free-mobile.fr/sendmsg?user={user}&pass={api_key}&msg={msg}'.format( + user=cust_id, + api_key=apiKey, + msg=msg_quoted, + ) req = Request(URL) # send the request to Free Mobile