Kalebu / alright

Python wrapper for WhatsApp web-based on selenium
https://www.youtube.com/watch?v=yitQTt-NukM
MIT License
355 stars 109 forks source link

New feature link preview #109

Open phofmeier opened 1 year ago

phofmeier commented 1 year ago

Overview

Added feature to wait for a Link Preview.

Successfully tested with Chrome Browser and Chrome-Driver 110.0.5481.77 Not tested with anything else.

Related to Issue #25

Implementation

pramadhana92 commented 1 year ago

It's working, thanks @phofmeier ! :)

phofmeier commented 1 year ago

This is cool @phofmeier

I see here you on the wait_for_link_preview(self, timeout=30) method, The timeout time to wait for the preview is configurable but you haven't provided the same flexibility when it's getting called in send_message() or send_direct_message() where the only configurable parameter is whether to enable or disable it.

Also Just to clarify is there some test you've run to make the 30s the default time to wait for the preview to show?

I changed the argument to provide access to change the timeout.

The time needed seams to be depending on the link and the used system. On my Andorid phone it most time needs around 5s and on IOS 1s. It looks like there is no good default value to provide.