soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
6.85k stars 388 forks source link

Trans only returns empty lines #354

Closed matheusfillipe closed 4 years ago

matheusfillipe commented 4 years ago

Worked for a while then suddenly does not produce any output:


# matheus @ arch-matheus in ~ [18:19:51]
$ trans amigo

# matheus @ arch-matheus in ~ [18:20:15]
$ trans hello

# matheus @ arch-matheus in ~ [18:20:20]
$ trans -V
Translate Shell       0.9.6.11

platform              Linux
terminal type         screen-256color
bi-di emulator        konsole
gawk (GNU Awk)        5.1.0
fribidi (GNU FriBidi) 1.0.9
audio player          mpv --no-config
terminal pager        less
web browser           xdg-open
user locale           en_US.UTF-8 (English)
home language         en
source language       auto
target language       en
translation engine    google
proxy                 [NONE]
user-agent            Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 Safari/602.1 Epiphany/3.18.2
ip version            [DEFAULT]
theme                 default
init file             [NONE]

Report bugs to:       https://github.com/soimort/translate-shell/issues
DrWursterich commented 4 years ago

I have had the same problem; Turns out, Google starts blocking your requests when you send them too many. Where "too many" seems to be a rather small number..

matheusfillipe commented 4 years ago

I think I sent something like 25 requests before getting blocked. This is kinda sad.

PedroExpedito commented 4 years ago

I have had the same problem

my solution is trans Hello -e bing change google translate for bing translate

adawdp commented 4 years ago

For Ubuntu ❰xubuntu 18.04❱: 1) sudo apt install proxychains4 2) cat /etc/proxychains4.conf ❰socks4 127.0.0.1 9050 ❨defaults set to "tor"❩❱ 3) sudo add-apt-repository ppa:micahflee/ppa ‖ sudo apt update ‖ sudo apt install torbrowser-launcher 4) proxychains4 trans -shell fr:en It works for me… 2020 Jul 14; 06:50 PM

matheusfillipe commented 4 years ago

For Ubuntu ❰xubuntu 18.04❱:

1. `sudo apt install proxychains4`

2. `cat /etc/proxychains4.conf ❰socks4  127.0.0.1 9050 ❨defaults set to "tor"❩❱`

3. `sudo add-apt-repository ppa:micahflee/ppa ‖ sudo apt update ‖ sudo apt install torbrowser-launcher`

4. `proxychains4 trans -shell fr:en`
   It works for me… 2020 Jul 14; 06:50 PM

Oh, nice idea. Probably just installing torsocks and doing:

torsocks trans batata

Is an easier/lazier solution. Just worked for me.

matheusfillipe commented 4 years ago

I have had the same problem

my solution is trans Hello -e bing change google translate for bing translate

Also a good solution. I am closing this since this is really most likely google blocking the requests and not necessarily an issue with trans. Also the workarounds work so.. yeah.

guidomz commented 5 months ago

Trans also returns empty line when using torsocks.

Oh, nice idea. Probably just installing torsocks and doing:

torsocks trans batata

Is an easier/lazier solution. Just worked for me.

These work (produces the expected translation behavior):

trans :en 'phrase to translate'
trans :en file://file.txt

These do not work (these only produce blanks):

torsocks trans :en 'phrase to translate'
torsocks trans :en file://file.txt

This is probably more of a torsocks problem, admittedly. But there may be something in your configuration that may help me achieve the same result you had. Thanks