From 28fcc1f59c744e1585be3fce5f59618356eb1926 Mon Sep 17 00:00:00 2001 From: oddluck <39967334+oddluck@users.noreply.github.com> Date: Thu, 2 Jul 2020 00:28:59 +0000 Subject: [PATCH] GoogleCloud: escape '&' character --- GoogleCloud/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GoogleCloud/plugin.py b/GoogleCloud/plugin.py index 4eb2a98..f59671c 100644 --- a/GoogleCloud/plugin.py +++ b/GoogleCloud/plugin.py @@ -62,10 +62,12 @@ class GoogleCloud(callbacks.Plugin): url = "https://translation.googleapis.com/language/translate/v2" if source != "auto": url += "?q={0}&target={1}&source={2}&key={3}".format( - text, target, source, key + text.replace("&", "%26"), target, source, key ) else: - url += "?q={0}&target={1}&key={2}".format(text, target, key) + url += "?q={0}&target={1}&key={2}".format( + text.replace("&", "%26"), target, key + ) response = requests.get(url, timeout=10) if not response.status_code == 200: log.debug(