diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-02-12 02:53:34 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-02-12 02:53:34 +0100 |
commit | d29d218edd81616cce42ebe0ce5593784bda3ec9 (patch) | |
tree | 3d7e7ac70273d2a9425bea9986096f5fc51da8ce /google-translate.sh | |
parent | e7b39c9f3cd1498cb04a18ecfb58f5d7c68eb2fb (diff) |
Diffstat (limited to 'google-translate.sh')
-rwxr-xr-x | google-translate.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/google-translate.sh b/google-translate.sh index f76c27a..e64b96e 100755 --- a/google-translate.sh +++ b/google-translate.sh @@ -4,4 +4,4 @@ text=$(cat) from_lang="auto" to_lang="en" user_agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -curl -gsLf --data-urlencode "q=$text" "https://translate.googleapis.com/translate_a/single?client=gtx&sl=$from_lang&tl=$to_lang&dt=t" | jq -r ".[0][0][0]" +curl -gsLf --data-urlencode "q=$text" "https://translate.googleapis.com/translate_a/single?client=gtx&sl=$from_lang&tl=$to_lang&dt=t" | jq -r '.[0][][0] | sub("\n"; "")' |