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

Code was runing fine but after wont work. looks like whatsapp blocked it #42

Closed homeplaya closed 2 months ago

homeplaya commented 3 months ago

At start code was runing fine after some days starting to have timeout error. So I logged out the device but now that I retry the QR just wont show.

3mora2 commented 3 months ago

Update lib Delete old session

homeplaya commented 3 months ago

I created a new seesion and QR showed up. However I have still the timeout initial error :

05-Apr-24 08:00:10 - ERROR - Exception in callback AsyncIOEventEmitter._emit_run..callback(<Task finishe...s exceeded.')>) at C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\pyee\asyncio.py:69 handle: <Handle AsyncIOEventEmitter._emit_run..callback(<Task finishe...s exceeded.')>) at C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\pyee\asyncio.py:69> Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\pyee\asyncio.py", line 77, in callback self.emit("error", exc) File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\pyee\base.py", line 211, in emit self._emit_handle_potential_error(event, args[0] if args else None) File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\pyee\base.py", line 169, in _emit_handle_potential_error raise error File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 66, in on_load await self._afterPageLoad() File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 83, in _afterPageLoad if await self.inject_api(): File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\WPP_Whatsapp\api\layers\HostLayer.py", line 457, in inject_api await self.ThreadsafeBrowser.page_wait_for_function( File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\WPP_Whatsapp\PlaywrightSafeThread\browser\threadsafe_browser.py", line 365, in page_wait_for_function return await self.page.wait_for_function(expression, arg=arg, timeout=timeout, polling=polling) File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\playwright\async_api_generated.py", line 11022, in wait_for_function await self._impl_obj.wait_for_function( File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\playwright_impl_page.py", line 1008, in wait_for_function return await self._main_frame.wait_for_function(**locals_to_params(locals())) File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\playwright_impl_frame.py", line 773, in wait_for_function return from_channel(await self._channel.send("waitForFunction", params)) File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\playwright_impl_connection.py", line 59, in send return await self._connection.wrap_api_call( File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\playwright_impl_connection.py", line 509, in wrap_api_call return await cb() File "C:\Users\Zotac\PythonProjects\3mora\venv\lib\site-packages\playwright_impl_connection.py", line 97, in inner_send result = next(iter(done)).result() playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded.

I am not sure how to update library, I have already last version of wpp whatsapp

3mora2 commented 3 months ago

debug message, ignore it

3mora2 commented 3 months ago

please send full log

homeplaya commented 3 months ago

I ran on the terminal : pip install --upgrade WPP_Whatsapp

some libraries were updated

had to correct and replace on the error files the operators | for the word : or

code was runing but in new version closed so added the :

creator.loop.run_forever()

so far it's working

3mora2 commented 3 months ago

python version ? errors files ?