raise JSONDecodeError
one2gov opened this issue · comments
Hi, my code is just simply as follows:
import py_translator
from py_translator import Translator
translator = Translator()
translator.translate('bonjour')
I would like to test the package and the text is so short within the limit. But it raise error:
raise JSONDecodeError("Expecting value", s, err.value) from None
and the error message is
JSONDecodeError: Expecting value
from py_translator import Translator
Translator().translate('bonjour').text
Error reappears after certain amount of iterations (maybe 100)
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Or... Use a proxy
from py_translator import Translator
proxy = {
'http': 'http://username:password@1.1.1.1:1234',
'https': 'http://username:password@1.1.1.1:1234',
}
s = Translator(proxies=proxy).translate(text='Hello my friend', dest='es').text
print(s)
I am also getting the same error and I have tried translation as single without iteration but still receiving same error. I have also tried by putting delay in code but nothing works. I am using python 3.6.
@markolofsen Can you fix this?
aparently it has already been done:
ssut/py-googletrans#51
But this branch has the group error that you solved.
Library was updated https://github.com/markolofsen/py_translator