Whatsapp aka. yowsup helper functions

ok, I found a fork, which adds media support and is also more up-to-date:

This fork switches to Python 3, version 2 is no longer supported.
you need more modules installed - otherwise it will even not start

For Mac - not yet tested with Raspberry:

You need to install the modules listed above for Python 3

pip3 install --upgrade pip
pip3 install argparse
pip3 install python-dateutil
pip3 install --upgrade readline
pip3 install protobuf
pip3 install pycrypto
pip3 install python-axolotl-curve25519
pip3 install --upgrade pillow

Mac only

brew install freetype imagemagick exiftool ffmpeg pkg-config
brew install libmagic
cd /usr/local/lib/
ln -s ../Cellar/libmagic/5.35/lib/libmagic.dylib libmagic.dylib

plus the additional modules for media support

pip3 install preview-generator
pip3 install xvfbwrapper
pip3 install urllib3
pip3 install idna
pip3 install chardet
pip3 install certifi
pip3 install cryptography

Download and install preview_generator

Download https://files.pythonhosted.org/packages/ce/17/9eeb6bc3a7cc1dc8ba7db35a2038c61bef49336ec21057258801e9aef2a5/preview_generator-0.9.tar.gz

unzip preview_generator-0.9.tar.gz
phyton3 ./setup.py install


Installing the new yowsup fork
Now download the new fork - clone this one to a new working dir

git clone https://github.com/AragurDEV/yowsup.git

Now run yowsup-cli with -y

yowsup-cli demos -l "491711234567:XXXXXX0uB6IMp9spB9FqedKFak=" -y

If you get a message “ModuleNotFoundError: No module named ‘Crypto’:” then run the following:

pip3 uninstall crypto
pip3 uninstall pycrypto
pip3 install pycrypto

If you get an error that MagicWand is not found:

I seems that MagicWand doesn't support imagemagick 7 yet as mentioned in other answers.
There's a new brew formula for Imagemagick 6 which can be used to install the older version in the meanwhile:

brew install imagemagick@6
Create a symlink to this newly installed dylib file as mentioned in other answer to get things working.
ln -s /usr/local/Cellar/imagemagick@6/<your specific 6 version>/lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib

In my case:
ln -s /usr/local/Cellar/imagemagick@6/6.9.10-14/lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib

New you could send a image on the yowsup-cli:

/image send <number> <image file>

If you see the error “ERROR:yowsup.layers.protocol_media.mediauploader:Error occured at transfer object of type ‘int’ has no len()” run

pip3 uninstall pyOpenSSL

see https://github.com/danielcardeenas/whatsapp-framework/issues/133

I’m still working on sending videos.