3mora2 / WPP_Whatsapp

WPP_Whatsapp aim of exporting functions from WhatsApp Web to the python, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination
MIT License
57 stars 9 forks source link

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

Closed alexferra closed 3 months ago

alexferra commented 3 months ago

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

3mora2 commented 3 months ago

Send all logs and error

alexferra commented 3 months ago

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

alexferra commented 3 months ago

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_forfunction(*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().runthreadsafe(func, timeout=timeout_) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Alefe\AppData\Roaming\Python\Python311\site-packages\PlaywrightSafeThread\browser\threadsafe_browser.py", line 298, in runthreadsafe 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

alexferra commented 3 months ago

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

3mora2 commented 3 months ago

Error say that qrcode not load May be

alexferra commented 3 months ago

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

3mora2 commented 3 months ago

What version you used

alexferra commented 3 months ago

thanks updating that worked