Forums

Unable to connect to whatsapp sever using yowsup python library

I have been trying to connect with the Whatsapp server using the yowsup library for python but am unable to do it. The connection seems to time out and I keep getting the message "Disconnected because closed" error message. When I try to do the same locally on my laptop I am able to connect without any issues. I am new to PythonAnywhere and was hoping to know what's different on PythonAnywhere that is causing this issue.Below is the error message that I keep getting. Hoping to hear from you at the earliest.

13:09 ~/yowsup-master/src $ ./yowsup-cli -d --send xxxxxxxxxxxx "Hello world" --wait --config config.example
YowsupConnectionManager: >>>>>>>> AUTH CALLED BinTreeNodeReader: Reader init YowsupAuth: Connecting to c2.whatsapp.net YowsupConnectionManager: Socket error, connection timed out ReaderThread: Sending disconnected because of closed Disconnected because closed

Hi, I think this is because you have a free PythonAnywhere account. Only paying customers (plans start at just a few dollars a month...) get unrestricted internet access.

Thanks for the prompt reply..I am able to read from the other websites using the urllib2 library.Is there any way to be sure that that could be the issue Because then I would definitely go for the Web dev plan. However, I want to know if I could get a tiny trial of unrestricted access to test if what you said is actually causing the problem before taking a plunge. I am thinking of eventually taking up the Startup Plan but need to be sure this library works on this platform.

Sure thing. I've switched it on for you now. You may need to kill all your consoles and log out + back in again for the IPtables settings to kick in. Let us know if everything works!

Thanks a ton for helping me out. Will surely check and see if things get done.I'm sure the restriction on internet access is whats causing the problem. Needed to be sure about it.I believe I should go for the 5$ a month plan for now. Just want to know if the unrestricted internet access has some limits set on data bandwidth.

Hi there, we don't have a formal restriction, no. We reserve the right to get grumpy if you start hogging all the bandwidth and trying to pipe terabytes of data in every hour, but that's never been a problem so far!