interlinearize icon indicating copy to clipboard operation
interlinearize copied to clipboard

Script not working with included test epub.

Open Amichayg opened this issue 4 years ago • 0 comments

It appears there is a problem with googletrans. Tested on fedora. Attached is the traceback.

Converting book to HTMLZ
Finding translations of new words
Exception in thread Thread-18 (translate_words):
Traceback (most recent call last):
  File "/usr/lib64/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/home/amichaygiuili/Downloads/interlinearize/interlinearize.py", line 320, in translate_words
    ts = translator.translate(words_to_translate, src=src, dest=dest)
  File "/home/amichaygiuili/.local/lib/python3.10/site-packages/googletrans/client.py", line 127, in translate
    translated = self.translate(item, dest=dest, src=src)
  File "/home/amichaygiuili/.local/lib/python3.10/site-packages/googletrans/client.py", line 132, in translate
    data = self._translate(text, dest, src)
  File "/home/amichaygiuili/.local/lib/python3.10/site-packages/googletrans/client.py", line 57, in _translate
    token = self.token_acquirer.do(text)
  File "/home/amichaygiuili/.local/lib/python3.10/site-packages/googletrans/gtoken.py", line 180, in do
    self._update()
  File "/home/amichaygiuili/.local/lib/python3.10/site-packages/googletrans/gtoken.py", line 59, in _update
    code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '')
AttributeError: 'NoneType' object has no attribute 'group'
^CTraceback (most recent call last):
  File "/home/amichaygiuili/Downloads/interlinearize/interlinearize.py", line 568, in <module>
    construct_word_list_from_text(word_list, word_dict, src_lan, dest_lan, service_urls, words_per_request)
  File "/home/amichaygiuili/Downloads/interlinearize/interlinearize.py", line 343, in construct_word_list_from_text
    t_dict = que.get()
  File "/usr/lib64/python3.10/queue.py", line 171, in get
    self.not_empty.wait()
  File "/usr/lib64/python3.10/threading.py", line 320, in wait
    waiter.acquire()
KeyboardInterrupt

Amichayg avatar Feb 05 '22 17:02 Amichayg