AlekPet / ComfyUI_Custom_Nodes_AlekPet

Custom nodes that extend the capabilities of Comfyui
MIT License
667 stars 45 forks source link

AttributeError: 'NoneType' object has no attribute 'group' #59

Open valleyss opened 3 weeks ago

valleyss commented 3 weeks ago

last update then something wrong , but it's work fine before update

got prompt comfyui | HTTP Request: GET https://translate.google.com "HTTP/1.1 200 OK" comfyui | !!! Exception during processing!!! 'NoneType' object has no attribute 'group' comfyui | Traceback (most recent call last): comfyui | File "/home/runner/ComfyUI/execution.py", line 151, in recursive_execute comfyui | output_data, output_ui = get_output_data(obj, input_data_all) comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/ComfyUI/execution.py", line 81, in get_output_data comfyui | return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/ComfyUI/execution.py", line 74, in map_node_over_list comfyui | results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/ComfyUI/custom_nodes/ComfyUI_Custom_Nodes_AlekPet/GoogleTranslateNode/google_translate_node.py", line 123, in translate_text comfyui | text_tranlsated = translate(text, from_translate, to_translate) if not manual_translate else text comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/ComfyUI/custom_nodes/ComfyUI_Custom_Nodes_AlekPet/GoogleTranslateNode/google_translate_node.py", line 66, in translate comfyui | translate_text_prompt = translator.translate(prompt, src=srcTrans, dest=toTrans) comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/.local/lib/python3.11/site-packages/googletrans/client.py", line 182, in translate comfyui | data = self._translate(text, dest, src, kwargs) comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/.local/lib/python3.11/site-packages/googletrans/client.py", line 78, in _translate comfyui | token = self.token_acquirer.do(text) comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | File "/home/runner/.local/lib/python3.11/site-packages/googletrans/gtoken.py", line 194, in do comfyui | self._update() comfyui | File "/home/runner/.local/lib/python3.11/site-packages/googletrans/gtoken.py", line 62, in _update comfyui | code = self.RE_TKK.search(r.text).group(1).replace('var ', '') comfyui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comfyui | AttributeError: 'NoneType' object has no attribute 'group' comfyui | comfyui | Prompt executed in 0.67 seconds

AlekPet commented 2 weeks ago

Hi, ok, I'll take a look. But I haven’t edited the google translate node for the last 2 months, maybe something has changed in comfyui or in the googletrans module itself. The error corresponds to an incorrect token that is needed for translation, maybe you need to update googletras-py via pip.

https://github.com/ssut/py-googletrans/issues/280

https://github.com/ssut/py-googletrans/issues/398