Code Monkey home page Code Monkey logo

yowsup's Introduction

yowsup Build Status

For private consultancy feel free to directly schedule it over codementor.


yowsup is a python library that enables building applications that can communicate with WhatsApp users. The project started as the protocol engine behind Wazapp for Meego and OpenWA for BB10. Now as a standalone library it can be used to power any custom WhatsApp client.

updated: 2021-12-14
yowsup version: 3.3.0
yowsup-cli version: 3.2.1
requires:
- python>=2.7,<=3.7
- consonance==0.1.5
- python-axolotl==0.2.2
- protobuf>=3.6.0
- six==1.10
uses:
 - argparse [yowsup-cli]
 - readline [yowsup-cli]
 - pillow [send images]
 - tqdm [mediasink demo]
 - requests [mediasink demo]

See also

During maintenance of yowsup, several projects have been spawned in order to support different features that get introduced by WhatsApp. Some of those features are not necessarily exclusive to WhatsApp and therefore it only made sense to maintain some parts as standalone projects:

Quickstart

Installation

Install using setup.py to pull all Python dependencies, or pip:

pip install yowsup

Linux

You need to have installed Python headers (probably from python-dev package) and ncurses-dev, then run

python setup.py install

FreeBSD (*BSD)

You need to have installed: py27-pip-7.1.2(+), py27-sqlite3-2.7.11_7(+), then run

pip install yowsup

Mac OS

python setup.py install

Administrators privileges might be required, if so then run with 'sudo'

Windows

  • Install mingw compiler
  • Add mingw to your PATH
  • In PYTHONPATH\Lib\distutils create a file called distutils.cfg and add these lines:
[build]
compiler=mingw32
  • Install gcc: mingw-get.exe install gcc
  • Install zlib
  • python setup.py install

License:

As of January 1, 2015 yowsup is licensed under the GPLv3+: http://www.gnu.org/licenses/gpl-3.0.html.

yowsup's People

Contributors

abloch avatar aguiraf avatar al-kateb avatar ant9000 avatar cataractar avatar cepiperez avatar coderus avatar dedmen avatar dinhoabreu avatar dl0tt avatar emamirazavi avatar felix-dumit avatar gagandeep avatar galmeida avatar gauravssnl avatar girish946 avatar ikkebr avatar jlgg avatar jlguardi avatar jlmadurga avatar knobtviker avatar mellesies avatar mgp25 avatar michaeljoseph avatar moyamo avatar nickcis avatar oxan avatar svisser avatar tgalal avatar treeuri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yowsup's Issues

New Bie

guys...looks like you are all pros in looking into whatsapp accounts. i am new bie and have no clue how this is done. i only have one number i want to look into. i have the imei as well as mac address. please let me know how i get started on this.

Register Params

Can anyone explain how and which params are passed to v.whatsapp.net/v2/code and v.whatsapp.net/v2/register? I am no expert in python but I saw the API sends many parameters like cc, in, lg, lc, mnc etc. But I tried to open the page in browser and I think (correct me if wrong) one parameter is necessary: "c". I am looking for a clarification on this. Thanx in advance

Message Sending Problem!

Hello ;

I have a problem. Connection is successful. Status code says the message is sent. But the messages are not actually sent. It's been happening since last night. Anybody having the same issue?

UnicodeDecodeError: 'ascii' codec can't decode byte

Hi

if you try to send a non English (non ascii) text you will get

Unhandled exception in thread started by
Traceback (most recent call last):
File "/home/XXXX/yowsup/Examples/EchoClient.py", line 63, in onAuthSuccess
self.methodsInterface.call("message_send", (self.jid, self.message))
File "/home/XXXX/yowsup/Yowsup/Interfaces/Interface.py", line 198, in call
return callback(*params)
File "/home/XXXX/yowsup/Yowsup/connectionmanager.py", line 426, in wrapped
node = fn(self, *args)
File "/home/XXXX/yowsup/Yowsup/connectionmanager.py", line 449, in sendText
return ProtocolTreeNode("body",None,None,content.encode('utf-8'));
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd9 in position 0: ordinal not in range(128)

I tried to use content.encode('utf-8', 'xmlcharrefreplace') and content.encode('utf-8', 'ignore') but all same issue

but when I remove encode everything is working fine

    @sendMessage
    def sendText(self,jid, content):
            return ProtocolTreeNode("body",None,None,content); 

yowsup-cli -l -a -k disconnect after 3 minutes.

When running "yowsup-cli -l -a -k" I receive after 3 minutes the message "Disconnected because closed".

This only happens, when the used account has received a chat message in the near past.

If enough time is passed since the last chat message, yowsup keeps connected.

Has anyone else seen this issue or an advice how to work around this?

New protocol?

Hi, I've used Wireshark to sniff traffic while I'm using yowsup and I've noticed that it is very different to the traffic I got when I sniff traffic using WhatsApp. With yowsup the first byte indicates if the stanza is encrypted and the next two bytes the size of the stanza. However with WhatsApp the first three bytes are "00 20 74" or "00 20 42" or "00 3e dc", and it doesn't make sense (0x2074 is a extremely large size). Is there a new protocol again?

AUTH FAIL

Hi all,
first, thanks all team for this info. I don´t know if anybody can help me or guide me to try find a solution.. when i run "python yowsup-cli -c config.example -d -s 34696423733 Hello" the command run but in the last time message me AUTH FAIL.
Anyone has had the same problem and if so, could find the solution? Thanks in advance all

Authentication failure using the API

I've been using Yowsup API for many days flawlessly. Anyway, since 2 days my code suddenly refuses to authenticate to Whatsapp, and on any authentication the auth_fail handler is always triggered. Was something changed in the authentication mechanism? Shall I provide further details?

CMDClient Error On Receiving Message

Hello,

When Using YowSup-CLI With The CmdClient (Interactive), The Following Error Occurs Upon Receiving A Message:
Unhandled exception in thread started by
TypeError: onMessageReceived() takes exactly 6 arguments (7 given).

The Solution Is To Remove The Additional pushName Arguement In The onMessageReceived() Method In src\Yowsup\connectionmanager.py:

Search For:
self.signalInterface.send("message_received", (msgId, fromAttribute, msgData, timestamp, wantsReceipt, pushName))

Replace With:
self.signalInterface.send("message_received", (msgId, fromAttribute, msgData, timestamp, wantsReceipt))

Best Regards

Problem logging in with my code, but yowsup-cli is fine

Well, I created a new account with yowsup-cli and then i updated config file with Password and tried to use command -l. Everything fine!

Then i created this small script:

from Examples.EchoClient import WhatsappEchoClient

wa = WhatsappEchoClient("393473****", "prova", False)
wa.login("39*********", "***************")

And I'm 100% sure the login (phone number with country code) and the password are correct! Maybe a bug of yowsup (in case, I've the problem that I don't know exactly how to reproduce this) or my problem? Any ideas?

Always exit CLI

Hi

I'm not expert in Python, but I would suggest if you change the CLI command to always exit the script even for errors

for example currently if you try the command line with wrong mobile or password it will display

[XXX@AAAA yowsup]$ ./yowsup-cli -c auth -s XXXXXXXX 'Hello'
Connecting to c.whatsapp.net
AUTH FAIL
Auth Failed!

it will just hang till someone press CTL+C

How I can I run youwsup from php?

I want to send and receive messages from php. I need to register a new number with the script "python. / Yowsup config.example-cli-c-d - requestcode voice".
I do not know python, how I can run this on my server from php?
Thanks for your understanding.

bug in message recieved time

|=> python yowsup-cli -c ~/.conf -i ************ -a [23:13] ruby-1.9.3-p194
Connecting to c.whatsapp.net
Authed ############
Starting Interactive chat with ************
Enter Message or command: (/available, /lastseen, /unavailable)
*********@s.whatsapp.net *[16-01-1970 21:22]: Check
Enter Message or command: (/available, /lastseen, /unavailable)

Shouldn't it be showing the message received time?

problems on profile_setPictureError() and delivered_ack

I want to set the profile picture by profile_setPicture(str filePath) and profile_setPictureError() always returns errorCode: 0. What does this errorCode mean? How I can set the profile picture through Yowsup?

Also, on receipt_messageDelivered event, methodsInterface.call("delivered_ack", (jid, messageId)) sometimes cannot send an ack to server. When I login again, the delivered message appear again... What does the jid in delivered_ack refer to? server jid or the jid that the message I sent to?

Thank you

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

[Question] --interactive not working

Im able to use --send and --listen without any issues but when trying to use the --interactive call the AUTH fails, any idea why?

Thanks in advance.

¿the password in the config file?

response_error
It is impossible for me to send a message through yowsup, I do not need to code the password in config file in the "password" field.
to request the code I get a code Whatsapp the format: XXX-XXX Is this the password for config?. if I put this code the lib base64.py throws an error.
Finally, when sending a message I receive "Auth Failed".
I attach the error.

Thankyou:))

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Cannot send images

I m trying to mimic this example from WhatsAPI:

venomous0x/WhatsAPI#51

By making the following call in CmdClient.py:

self.methodsInterface.call("message_imageSend",(self.jid,"http://www.anony.ws/i/2012/10/15/JKetE.jpg","JKetE.jpg",270038,open("/Users/fons/thumb.jpgb64",'r').read()))

which worked nicely under whatsapi the last time I tried. However, I get the following error:


ignored toString call, probably encountered byte
ignored toString call, probably encountered byte
Unhandled exception in thread started by >

Any tips on how to make it work? (sending textual messages works without problems)

Thanks in advance

utf-8 send

Hi

i ask how send utf-8 message via cmd

thanks

Registration with sms code not possible

On November, 10th, the registration of a new phone number with sms was possible and worked very well. From November, 18th till now I'm trying to register 3 more numbers but no sms is sent to me.

I got the following message back every time: Got response: success-sent:60

Can anybody confirm that or give me a hint what I'm doing wrong?

How to save password into a xml file ?

Hi is there any way via which i can execute the python command from php script for getting password and store it into xml file ?

I tried running

$x=exec(""python ./yowsup-cli -c config.example -d -R verifciationcode");
and echoing $x;

but its giving following error

File "./yowsup-cli", line 234, in
print resultToString(result)UnicodeEncodeError: 'ascii' codec can't encode character u'\u20b9' in position 62: ordinal not in range(128)

so i taught if i can redirect the output to some xml file it could be solved.

Login failed today

Hi

it seems new change in WhatsApp login process.

I'm getting the following error

YowsupConnectionManager: >>>>>>>> AUTH CALLED
BinTreeNodeReader: Reader init
Connecting to c.whatsapp.net
WAuth: Yowsup WAUTH-1 INIT
WAuth: Starting stream
WAuth: Sending Features
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:
stream:features
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
/w:profile:picture
<w:profile:picture type="group">
/w:profile:picture




/stream:features

WAuth: Sending Auth
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:

WAuth: Read stream start
WAuth: Read features and challenge
BinTreeNodeReader: Incoming
BinTreeNodeReader:
stream:features
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
/w:profile:picture


/stream:features

WAuth: GOT FEATURES !!!!
BinTreeNodeReader: Incoming
BinTreeNodeReader:

8?1???lU4?????Q(?

WAuth: GOT CHALLENGE !!!!
WAuth: Sending Response
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:

??4{?\t???1$#n?B???????t?{?)????SJ?"?l}$-

WAuth: Read success
BinTreeNodeReader: Incoming
BinTreeNodeReader:



WAuth: Login Status: failure
AUTH FAIL
Auth Failed!
YowsupConnectionManager: >>>>>>>> AUTH CALLED
BinTreeNodeReader: Reader init
Connecting to c.whatsapp.net
WAuth: Yowsup WAUTH-1 INIT
WAuth: Starting stream
WAuth: Sending Features
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:
stream:features
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
/w:profile:picture
<w:profile:picture type="group">
/w:profile:picture




/stream:features

WAuth: Sending Auth
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:

WAuth: Read stream start
WAuth: Read features and challenge
BinTreeNodeReader: Incoming
BinTreeNodeReader:
stream:features
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
/w:profile:picture


/stream:features

WAuth: GOT FEATURES !!!!
BinTreeNodeReader: Incoming
BinTreeNodeReader:

[?pY??q?5J_-g???
??

WAuth: GOT CHALLENGE !!!!
WAuth: Sending Response
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:

ODW?N????9>'?
?l???BY?;??xzX?#?????0???

WAuth: Read success
BinTreeNodeReader: Incoming
BinTreeNodeReader:



WAuth: Login Status: failure
AUTH FAIL
Auth Failed!
YowsupConnectionManager: >>>>>>>> AUTH CALLED
BinTreeNodeReader: Reader init
Connecting to c.whatsapp.net
WAuth: Yowsup WAUTH-1 INIT
WAuth: Starting stream
WAuth: Sending Features
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:
stream:features
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
/w:profile:picture
<w:profile:picture type="group">
/w:profile:picture




/stream:features

WAuth: Sending Auth
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:

WAuth: Read stream start
WAuth: Read features and challenge
BinTreeNodeReader: Incoming
BinTreeNodeReader:
stream:features
<receipt_acks>
</receipt_acks>
<w:profile:picture type="all">
/w:profile:picture


/stream:features

WAuth: GOT FEATURES !!!!
BinTreeNodeReader: Incoming
BinTreeNodeReader:

?E??ؐ??j???$?/???|k

WAuth: GOT CHALLENGE !!!!
WAuth: Sending Response
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:

?#???u䫿6????%??u??#?:l_?w?$%?#????^?n?0J?

WAuth: Read success
BinTreeNodeReader: Incoming
BinTreeNodeReader:



WAuth: Login Status: failure
AUTH FAIL
Auth Failed!

Configuration

Add methods for setting configuration.

-Keep alive
-Debug on/off

possisble CC detection issue with --sync

given the country code of spain (34), I attach de debug output of
-d --sync 650xxxxxx

WAContactsSyncQuery:
{"c":[{"p":"650xxxxxx","n":"34650xxxx","s":"bla bla bla","t":1356700941,"w":1}

and the output of
-d --sync 34650xxxxxx
specifying the number with the country code as always did:

{"p":"34650xxxxxx","n":" 3434650xxxxxx","w":0}

both cases report country code 34 as detected.
this error happens wether config file has cc configuration or not.

so, numbers outside my country cannot be checked

WhatsApp + Yowsup + Twitter = Social Alerts

Hi

I developed small script using Yowsup and Twitter API to monitor any twitter account and send whatsapp message for any new tweets to my mobile, it seems to be working fine with me and I'm using it to get breaking news from BBC, CNN and other twitter accounts.

I would like to develop a complete web app that allow users to register and monitor any twitter accounts and receive whatsapp messages for any new tweets but my questions are:

  1. Anyone knows any limitation in Whatsapp ? (e.g. limitation in number of messages whatsapp account can send per hour,day?)
  2. Anyway to register fake whatsapp accounts (in order to use it to send whatsapp messages)?
  3. Anyway to use yowsup and whatsapp mobile client (app) in the same time for the same account?

Thanks

Error in register new number for sending message

On Monday i have register 5 number its working . But when i try to register today i get this error .
Please help me .

C:\Python27\python.exe C:/Python27/yowsup/yowsup-cli -c config -r sms
status: fail
param: number
reason: bad_param

Process finished with exit code 0

running yowsup from php

Hello,

Any example of how to run intermediate
with yowsup.py running and passing parameters from php to send a message or retrieving contact data form php?

Thankyou

Error when calling --register

the error is :
tranceback (most recent call last):
file "c:\pythonapp\yowsup-cli.py",line 230,in( module)
print resultToString(result)
file "c:\python27\lib\encodings\cp437.py",line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: ' charmap' codec can't encode character u'\u20ac' in position 67: character maps to (undefined)

thank you so much

Corrupted profile pictures (Windows)

The contact_getProfilePicture call downloads a corrupted jpeg (I tried with almost every contact I have in whatsapp).
I'm using the module on Windows with python 2.6.4

How can I be sure that the message sent

Hello ,

When I send a message i get "message sent" but i can't know whatsapp server has sent this message ,How do I know that "the message delivered" , I work in a language programming php ,please help

Cannot send messages

Hi, with the new version I can't send messages. I get an AUTH FAIL message and

< failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl" >
< not-authorized >
< /not-authorized >
< /failure >

It seems that the response is not correctly generated. I've updated the config and I've specified the v1 flag. I also try with an older version (4 days ago) and it works perfectly.
Thanks

Sniff new Api Password

Thank your for the latest commits. But what I really want do to is use whatsapp on the phone AND on the computer.

In earlier versions you could sniff the register request of the phone with a ssl proxy. This is not working anymore.

How to get the password out of the phone or how to sniff(i.e decrypt) the register process?

Status?

hi,

have yowsup a method to set the status ?

Webgui

hi,

a search little webgui or webgui - for one person not as service for everyone!

  • send messages
  • recieve messages
  • add contacts
  • save into txt / mysql database
    & fixx the keep alive timeout

It is NOT ONLY FOR ME it is for the yowsup Community Users / Developer .. and i will NOT PAY open source based on yowsup .. thanks

"/lastseen" error in yowsup-cli

|=> python yowsup-cli -c ~/.conf -i ********* [14:03] ruby-1.9.3-p194
Connecting to c.whatsapp.net
Authed #########
Starting Interactive chat with *********
Enter Message or command: (/available, /lastseen, /unavailable)
/lastseen
Unhandled exception in thread started by <Examples.CmdClient.WhatsappCmdClient instance at 0x7f713d7a53b0>>
Traceback (most recent call last):
File "/home/abdulkarim/project/yowsup/src/Examples/CmdClient.py", line 74, in onPresenceUpdated
self.onMessageReceived(0, jid, "LAST SEEN RESULT: %s"%formattedDate, long(time.time()) * >1000, False)
TypeError: onMessageReceived() takes exactly 7 arguments (6 given)

yowsup seems to login when it theoricalyy shouldn't

I've been able to authenticate by using the application and send a message. However, I've added this:

print "Pass--%s--" % password
sys.exit(0)

right after

password = identity or password if args["v1"] else base64.b64decode(password)

in order to test it using https://r.whatsapp.net/v1/exist.php?cc=myCountryCode&in=myPhoneNumber&udid=printedPassword

But it results in failure. There's something strange here...

EDIT: Yeah, I know about the login changes in WhatsApp, the new random assigned password which requires base64 decoding, and that stuff, but I thought this URL could also be used to check the newest credentials. For what it seems, this URL is no longer valid, so, anyone knows which is its equivalent for the v2 (replacing v1 for v2 doesn't work xD)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.