scripts icon indicating copy to clipboard operation
scripts copied to clipboard

translate.py do not work at all

Open pascalpoitras opened this issue 10 years ago • 4 comments

I typed /translate en_it I want this string in italian Here is the output: 14:06 python: stdout/stderr: Traceback (most recent call last): 14:06 python: stdout/stderr: File "/home/launch/.weechat/python/autoload/translate.py", line 91, in translate_process_cb 14:06 python: stdout/stderr: translated = ''.join([x['trans'] for x in json.loads(translate['stdout'])['sentences']]) 14:06 python: stdout/stderr: File "/usr/lib/python2.7/json/init.py", line 338, in loads 14:06 python: stdout/stderr: return _default_decoder.decode(s) 14:06 python: stdout/stderr: File "/usr/lib/python2.7/json/decoder.py", line 366, in decode 14:06 python: stdout/stderr: obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 14:06 python: stdout/stderr: File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode 14:06 python: stdout/stderr: raise ValueError("No JSON object could be decoded") 14:06 python: stdout/stderr: ValueError: No JSON object could be decoded 14:06 =!= python: error in function "translate_process_cb"

pascalpoitras avatar Jul 12 '15 18:07 pascalpoitras

If I recall correctly that script is using Google Translate and the free API was closed years ago.

Mikaela avatar Jul 12 '15 18:07 Mikaela

It works 2 weeks ago and then it stop working with the same error. Now it works again. Is the api limiting the number of request or something like that?

pascalpoitras avatar Nov 07 '15 06:11 pascalpoitras

wow and now it stops working. It works for 5 minutes then stop working then it works and so on. It is probably not a problem in the script

pascalpoitras avatar Nov 07 '15 06:11 pascalpoitras

Did you find the reason to why it stopped working? I'm getting the same error (somewhat)..

This is from running '/translate exotique' in one of the channels i'm in. I chose to translate from french, since that's the default setting when you first installed the script (and ofc, the output is shown in the weechat/status buffer).

│1225     │ python: stdout/stderr (colorize_nicks): Traceback (most recent call last):
│1225     │ python: stdout/stderr (translate): Traceback (most recent call last):
│1225     │ python: stdout/stderr (colorize_nicks):   File "/home/meffe/.weechat/python/translate.py", line 91, in translate_process_cb
│1225     │ python: stdout/stderr (translate):   File "/home/meffe/.weechat/python/translate.py", line 91, in translate_process_cb
│1225     │ python: stdout/stderr (colorize_nicks):     translated = ''.join([x['trans'] for x in json.loads(translate['stdout'])['sentences']])
│1225     │ python: stdout/stderr (translate):     translated = ''.join([x['trans'] for x in json.loads(translate['stdout'])['sentences']])
│1225     │ python: stdout/stderr (colorize_nicks): TypeError: string indices must be integers
│1225     │ python: stdout/stderr (translate): TypeError: string indices must be integers
│1225 =!= │ python: error in function "translate_process_cb"

...and yeah, I would really like it if I was able to use the script - even if it's regulated to X n's of translations per min/hour/day.

Anyone have a clue what's going on?

meffovic avatar May 26 '18 10:05 meffovic