sinedie/SRTranslator

Timed out trying to get element

Closed this issue · 4 comments

i got this error.

... Translating chunk. 63 %
Timed out trying to get element (XPATH = //button[@DL-test='translator-lang-option-ja'] | //button[text()='Japanese'])

I seem to get an error when I get more than 3000 lines.

my srtranslator version is 0.1.95

Can you run it with "-s" flag to see what is happening in the browser? so I can replicate it in my machine. Ty

lleans commented

I have the same issue here. v 0.2.0

Nothing much happen in browser, and I've different issue. I'm translating only about 735 text, then it said Timeout to find Element.

DevTools listening on ws://127.0.0.1:55560/devtools/browser/e64a607c-03fc-455e-a166-de56428a76fe
Loading ep1-sub-refrence-cut-1.srt
... Translating chunk. 0 %
... Translating chunk. 38 %
Timed out trying to get element (XPATH = //button[@dl-test='translator-lang-option-zh'] | //button[text()='Chinese'])`

Oh, on this one I've tried to split the subs into two and I'm using Chrome here. tried to using the default Geckodriver(by Installing Firefox) throw a different Exception, this one is Translation timed out

Traceback (most recent call last):
  File "D:\python\env\speech-recog-xlr\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\python\env\speech-recog-xlr\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\python\env\speech-recog-xlr\lib\site-packages\srtranslator\__main__.py", line 110, in <module>
    srt.translate(translator, args.src_lang, args.dest_lang)
  File "D:\python\env\speech-recog-xlr\lib\site-packages\srtranslator\srt_file.py", line 151, in translate
    translation = translator.translate(
  File "D:\python\env\speech-recog-xlr\lib\site-packages\srtranslator\translators\deepl_scrap.py", line 126, in translate
    raise TimeOutException("Translation timed out")
srtranslator.translators.base.TimeOutException: Translation timed out

On this try, I've got this warning on deepl, and I think you're already handle it. After that back to normal
image
Then the translation just stopped, idk probably the rate limiting that deepl implement. The TL wasn't done yet.
image
I don't know if this will helpful, I've tried the verbose log nothing helpful come out.

Ok... so, the translator changed the language for each chunk of file and it doesn't make any sense. It should only change the language if you are going to translate another thing.

You guys got a time out when trying to change that language in the middle of translation. So, that's the issue.

Last release, 0.2.1 (available in PyPi) solved this. I hope it fix this. If so, feel free to close it.

Ok... so, the translator changed the language for each chunk of file and it doesn't make any sense. It should only change the language if you are going to translate another thing.

You guys got a time out when trying to change that language in the middle of translation. So, that's the issue.

Last release, 0.2.1 (available in PyPi) solved this. I hope it fix this. If so, feel free to close it.

Thank you. The problem was fixed after the update 0.2.1