Unfortunately, due to recent updates in whatsapp servers, bots are beeing banned real quickly. My new numbers were banned within minutes. Since WhatsApp is a closed protocol, yowsup is responsible for the reverse engineering to understand the messages exchange from whatsapp server. If a new protocol will pop, project will return. Until then, sadly, the project will be on hold. Use on your own risk.
yowjs
is a node module, distributed via NPM and allows you to easily intergrate yowsup
(Python library) into a node application. yowjs
is essantially an event
based proxy and allows you easily to communicate with yowsup
without any Python being involved.
Add yowjs
you your package.json file and install it via npm install. yowjs
is dependent on yowsup
and must be install manually.
npm install yowjs --save-dev
sudo pip install yowsup2 <--upgrade>
const YowJS = require('yowjs');
let yowsup = new YowJS();
// init the connection params
yowsup.initialize(
config.countryCode,
config.phoneNumber,
config.password
)
.on('ON_MESSAGE', message => { // bind to incoming events from yowsup cli
console.log(['incoming msg', message]);
})
.on('LINK_DEAD', () => {
// re-init, connection lost
console.log('connection lost');
})
.connect(); // establish connection.
Clone this repo (or fork it)
git clone [email protected]:landrover/yowjs.git
Install deps
npm install
cli
MCC/MNC: https://en.wikipedia.org/wiki/Mobile_country_code
yowsup-cli registration --requestcode sms --phone 972XXXXXXXXX --cc 972 --mcc 425 --mnc 03 --env android
yowsup-cli registration --register 123456 --phone 972XXXXXXXXX --cc 972 --env android
Install deps
npm install
- Sometimes the queue of the bot is too big and requires a cleanup (encryption etc..)
- Run few times this:
yowsup-cli demos -e -d -l NUMBER:PWD
- Run few times this:
- Minimum version bump
/usr/local/lib/python2.7/dist-packages/yowsup/env/env_android.py
- _MD5_CLASSES = "7/+9fBNI2d4/UxUiSUd+OQ=="
- _VERSION = "2.18.190"
- UTF8 support, patched manually in Yowsup:
- in
/usr/local/lib/python2.7/dist-packages/yowsup/layers/__init__.py
add at the top of the file:
- in
import sys
reload(sys)
sys.setdefaultencoding('utf8')
- comments