3mora2/WPP_Whatsapp

was working recently, updated to the latest version and just timesouts client = creator.start()

Closed this issue · 8 comments

was working recently, updated to the latest version and just timesouts client = creator.start()

Send all logs and error

it works sometimes when I remove the linked devices from my phone.

27-Mar-24 13:40:48 - ERROR - Exception in callback AsyncIOEventEmitter._emit_run..callback(<Task finishe...s exceeded.')>) at C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\asyncio.py:65
handle: <Handle AsyncIOEventEmitter._emit_run..callback(<Task finishe...s exceeded.')>) at C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\asyncio.py:65>
Traceback (most recent call last):
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\asyncio.py", line 71, in callback
self.emit("error", exc)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\base.py", line 179, in emit
self._emit_handle_potential_error(event, args[0] if args else None)
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\pyee\base.py", line 139, in _emit_handle_potential_error
raise error
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 68, in on_load
await self._afterPageLoad()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 89, in _afterPageLoad
await self.afterPageScriptInjected()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\Whatsapp.py", line 94, in afterPageScriptInjected
await self._afterPageScriptInjectedHost()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 103, in _afterPageScriptInjectedHost
await self.__checkQrCode()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 188, in __checkQrCode
result = await self.__getQrCode()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 296, in __getQrCode
qr_result = await self.scrapeImg()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 577, in scrapeImg
await self.ThreadsafeBrowser.page_wait_for_function("()=>document.querySelector('canvas')?.closest")
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 468, in page_wait_for_function
return await self.create_task(self.page.wait_for_function(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 281, in create_task
return await self.loop.create_task(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright\async_api_generated.py", line 11664, in wait_for_function
await self._impl_obj.wait_for_function(
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_page.py", line 946, in wait_for_function
return await self.main_frame.wait_for_function(**locals_to_params(locals()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_frame.py", line 763, in wait_for_function
return from_channel(await self.channel.send("waitForFunction", params))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 44, in send
return await self.connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 419, in wrap_api_call
return await cb()
^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 79, in inner_send
result = next(iter(done)).result()
^^^^^^^^^^^^^^^^^^^^^^^^^
playwright.impl.api_types.TimeoutError: Timeout 30000ms exceeded.
Traceback (most recent call last):
File "C:\Users\Alefe\source\repos\Sales Tax A\instagrapi\examples\whatsappBOT.py", line 10, in
client = creator.start()
^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\initializer.py", line 123, in start
self.create_sync()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\initializer.py", line 173, in create_sync
is_logged = self.client.waitForLogin()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 446, in waitForLogin
self.waitForPageLoad()
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 368, in waitForPageLoad
self.ThreadsafeBrowser.page_wait_for_function_sync("() => WPP.isReady")
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 489, in page_wait_for_function_sync
return self.run_threadsafe(self.page.wait_for_function(*args, **kwargs), timeout
=timeout
)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\WPP_Whatsapp\controllers\browser.py", line 52, in run_threadsafe
return super().run_threadsafe(func, timeout
=timeout
)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 298, in run_threadsafe
result = future.result(timeout=timeout
)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 401, in __get_result
raise self._exception
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright\async_api_generated.py", line 11664, in wait_for_function
await self._impl_obj.wait_for_function(
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_page.py", line 946, in wait_for_function
return await self._main_frame.wait_for_function(**locals_to_params(locals()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_frame.py", line 763, in wait_for_function
return from_channel(await self._channel.send("waitForFunction", params))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 44, in send
return await self._connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 419, in wrap_api_call
return await cb()
^^^^^^^^^^
File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\playwright_impl_connection.py", line 79, in inner_send
result = next(iter(done)).result()
^^^^^^^^^^^^^^^^^^^^^^^^^
playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.

Process finished with exit code 1

the first time it works, after its linked, if I run it I get that

Error say that qrcode not load
May be

  • you use Firefox without headless mode, Firefox take long time to do action and need tab to be focus
  • You can use chromium or other than Firefox
  • try start with async no time out

I use chromium . it doesn't work after the first run.

What version you used

thanks updating that worked