mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-29 06:51:12 -05:00
GoogleCloud: escape '&' character
This commit is contained in:
parent
eb6ea74d44
commit
28fcc1f59c
@ -62,10 +62,12 @@ class GoogleCloud(callbacks.Plugin):
|
|||||||
url = "https://translation.googleapis.com/language/translate/v2"
|
url = "https://translation.googleapis.com/language/translate/v2"
|
||||||
if source != "auto":
|
if source != "auto":
|
||||||
url += "?q={0}&target={1}&source={2}&key={3}".format(
|
url += "?q={0}&target={1}&source={2}&key={3}".format(
|
||||||
text, target, source, key
|
text.replace("&", "%26"), target, source, key
|
||||||
)
|
)
|
||||||
else:
|
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)
|
response = requests.get(url, timeout=10)
|
||||||
if not response.status_code == 200:
|
if not response.status_code == 200:
|
||||||
log.debug(
|
log.debug(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user