tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.08k stars 2.23k forks source link

Yowsup-cli crashing when receiving Audio and Videos #716

Closed lcmeyer37 closed 9 years ago

lcmeyer37 commented 9 years ago

Hey people, I notice that as "media" types you have: 'image', 'location', 'vcard'. So, when I send pictures, locations and contact to my yowsup-cli it double checks grey notifying receipt and also prints the data on the console. But, when I send an audio or a video the program crashes giving the following:

Microsoft Windows [versao 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Users\MEYERLU>cd c:\pythonn34\scripts O sistema nao pode encontrar o caminho especificado.

C:\Users\MEYERLU>cd c:\python34\scripts

c:\Python34\Scripts>python yowsup-cli demos -y -l number:password -d DEBUG:yowsup.stacks.yowstack:Initializing stack DEBUG:yowsup.stacks.yowstack:Constructed Network Layer DEBUG:yowsup.stacks.yowstack:Constructed Stanza Regulator Layer DEBUG:yowsup.stacks.yowstack:Constructed Crypt Layer DEBUG:yowsup.stacks.yowstack:Constructed Coder Layer DEBUG:yowsup.stacks.yowstack:Constructed Logger Layer DEBUG:yowsup.stacks.yowstack:Constructed Authentication Layer - Messages Layer - Receipt Layer - Ack Layer - Presence Layer - Ib Layer - Iq Layer - notification Ib Layer - Iq Layer - Chatstate Layer - Groups Iq Layer - Media Layer - Privacy Layer DEBUG:yowsup.stacks.yowstack:Constructed CLI Interface Layer

Yowsup Cli client

Type /help for available commands

[offline]:/login number password DEBUG:yowsup.layers.logger.layer:tx: stream:features

/stream:features

DEBUG:yowsup.layers.logger.layer:tx:

↑kës²Bp<Ñt\xae)H\xd7↓YbN▬\xd7l\xd0eW¶\xd4+íg@kx\xf8♣↔±\xcb\x95\xfe\x85«\x97\x8a\ x8fÇ-\xd9 HEX3:b'186beb73b242703cd174ae2948d71959624e16d76cd0655714d42bed67406b78f8051db1c b95fe85ab978a8fc72dd9'

DEBUG:yowsup.layers.logger.layer:rx: stream:features /stream:features

DEBUG:yowsup.layers.logger.layer:rx: \xb4B☻t☻↑üÅ↑\x8fíu\x87¥)q'\xceR HEX3:b'b44202740218fcc5188fed7587a5297127ce5207'

DEBUG:yowsup.layers.protocol_iq.layer:starting ping thread. Auth: Logged in! DEBUG:yowsup.layers.logger.layer:rx:

<media duration="3" ip="184.173.204.54" filehash="UzYuJ4X01TsmkDCmSP3iXwTUo/DThF +nZQ9HGEIJyyc=" size="5209" acodec="amrnb" type="audio" encoding="raw" seconds=" 2" file="As-wELunOyt8i6UoT7nE2kKiMtc3mh3K4i36dnfYorYr.3ga" url="https://mmi611.w hatsapp.net/d/QrJJV6lDPD1ePmxKxsKk_1UwD2AABRPclqOzAg/As-wELunOyt8i6UoT7nE2kKiMtc 3mh3K4i36dnfYorYr.3ga" asampfreq="8000" abitrate="12" mimetype="audio/3gpp" asam pfmt="flt">

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.logger.layer:rx:

DEBUG:yowsup.layers.logger.layer:rx: <message from="number@s.whatsapp.net" notify="Lucas Meyer" t="1429214180" id="1429200347-70" type="media"> <media duration="3" ip="198.11.217.202" filehash="RyhVQQzsp+yE9h5XpEOhRKVTZkWKge d1Tv8gh2S61ZI=" size="4825" acodec="amrnb" type="audio" encoding="raw" seconds=" 2" file="AluqA5uTbqPydUt0a2cmsYpNmSScX3n57NhQxwng3Tt-.3ga" url="https://mmi203.w hatsapp.net/d/f_R6tE8YVEMKbgdTzgE7b1UwE-QABRPc24WjQw/AluqA5uTbqPydUt0a2cmsYpNmSS cX3n57NhQxwng3Tt-.3ga" asampfreq="8000" abitrate="12" mimetype="audio/3gpp" asam pfmt="flt">

DEBUG:yowsup.layers.logger.layer:rx: stream:error

/stream:error

DEBUG:yowsup.layers.network.layer:Disconnected, reason: Connection Closed Traceback (most recent call last): File "yowsup-cli", line 304, in if not parser.process(): File "yowsup-cli", line 223, in process self.startCmdline() File "yowsup-cli", line 249, in startCmdline stack.start() File "C:\Python34\lib\site-packages\yowsup\demos\cli\stack.py", line 28, in st art self.stack.loop(timeout = 0.5, discrete = 0.5) File "C:\Python34\lib\site-packages\yowsup\stacks\yowstack.py", line 162, in l oop asyncore.loop(_args, *_kwargs) File "C:\Python34\lib\asyncore.py", line 208, in loop poll_fun(timeout, map) File "C:\Python34\lib\asyncore.py", line 153, in poll read(obj) File "C:\Python34\lib\asyncore.py", line 87, in read obj.handle_error() File "C:\Python34\lib\asyncore.py", line 83, in read obj.handle_read_event() File "C:\Python34\lib\asyncore.py", line 442, in handle_read_event self.handle_read() File "C:\Python34\lib\site-packages\yowsup\layers\network\layer.py", line 48, in handle_read self.receive(data) File "C:\Python34\lib\site-packages\yowsup\layers\network\layer.py", line 55, in receive self.toUpper(data) File "C:\Python34\lib\site-packages\yowsup\layersinit.py", line 55, in to Upper self.upper.receive(data) File "C:\Python34\lib\site-packages\yowsup\layers\stanzaregulator\layer.py", l ine 30, in receive self.toLower(data) File "C:\Python34\lib\site-packages\yowsup\layers__init.py", line 59, in to Lower self.__lower.send(data) File "C:\Python34\lib\site-packages\yowsup\layers\network\layer.py", line 52, in send self.initiate_send() File "C:\Python34\lib\asyncore.py", line 536, in initiate_send num_sent = dispatcher.send(self, self.out_buffer[:65536]) File "C:\Python34\lib\asyncore.py", line 366, in send result = self.socket.send(data) OSError: [WinError 10038] Foi tentada uma operaç\xe3o em algum item que n\xe3o é um soquete

So, how do I properly ignore any type of message that is not 'text'? Because, I'm coding a client and it cashes too when I receive Audio and Videos.

Thanks,

Lucas Meyer.

lcmeyer37 commented 9 years ago

Anyone can please help me with this? I really need to just implement this error basically to finish. I'm just trying for the moment to work with receiving text messages, but if I get other types of message or medias like audio and video this error appears, and I just need to ignore them.

rajesh-h commented 9 years ago

@lcmeyer37 Were you able to resolve this?

ronromer commented 8 years ago

+1

pabloruan0710 commented 8 years ago

+1

jlguardi commented 8 years ago

You can try my master.