joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
726 stars 245 forks source link

cant send videos, everything else works now #74

Closed e0xify closed 8 years ago

e0xify commented 8 years ago

its downloading the videos but when it trys to send it it crashes with 100 %

server.py [ERROR][2016-04-15 15:17:36,302] Unexpected Exception: Must specify either to or _from jids to create the message
Traceback (most recent call last):
File "src/server.py", line 38, in start
self.stack.loop(timeout=0.5, discrete=0.5)
File "build/bdist.linux-x86_64/egg/yowsup/stacks/yowstack.py", line 187, in loop
asyncore.loop(_args, *_kwargs)
File "/usr/lib/python2.7/asyncore.py", line 216, in loop
poll_fun(timeout, map)
File "/usr/lib/python2.7/asyncore.py", line 201, in poll2
readwrite(obj, flags)
File "/usr/lib/python2.7/asyncore.py", line 123, in readwrite
obj.handle_error()
File "/usr/lib/python2.7/asyncore.py", line 108, in readwrite
obj.handle_read_event()
File "/usr/lib/python2.7/asyncore.py", line 444, in handle_read_event
self.handle_read()
File "build/bdist.linux-x86_64/egg/yowsup/layers/network/layer.py", line 102, in handle_read
self.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/network/layer.py", line 110, in receive
self.toUpper(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/init.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/stanzaregulator/layer.py", line 29, in receive
self.processReceived()
File "build/bdist.linux-x86_64/egg/yowsup/layers/stanzaregulator/layer.py", line 49, in processReceived
self.toUpper(oneMessageData)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/auth/layer_crypt.py", line 65, in receive
self.toUpper(payload)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/coder/layer.py", line 35, in receive
self.toUpper(node)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/logger/layer.py", line 14, in receive
self.toUpper(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/axolotl/layer.py", line 145, in receive
self.toUpper(protocolTreeNode)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 188, in receive
s.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/init.py", line 120, in receive
if not self.processIqRegistry(node):
File "build/bdist.linux-x86_64/egg/yowsup/layers/init.py", line 155, in processIqRegistry
successClbk(protocolTreeNode, originalIq)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_media/layer.py", line 78, in onRequestUploadSuccess
self.toUpper(ResultRequestUploadIqProtocolEntity.fromProtocolTreeNode(resultNode))
File "build/bdist.linux-x86_64/egg/yowsup/layers/init.py", line 75, in toUpper
self.upper.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/__init
.py", line 188, in receive
s.receive(data)
File "build/bdist.linux-x86_64/egg/yowsup/layers/interface/interface.py", line 75, in receive
if not self.processIqRegistry(entity):
File "build/bdist.linux-x86_64/egg/yowsup/layers/interface/interface.py", line 54, in processIqRegistry
successClbk(entity, originalIq)
File "/home/scripts/wabot/test/whatsapp-bot-seed/src/utils/media_sender.py", line 66, in
originalEntity, caption)
File "/home/scripts/wabot/test/whatsapp-bot-seed/src/utils/media_sender.py", line 88, in _on_upload_result
self._do_send_file(file_path, upload_result.getUrl(), jid, upload_result.getIp(), caption)
File "/home/scripts/wabot/test/whatsapp-bot-seed/src/utils/media_sender.py", line 105, in _do_send_file
entity = VideoDownloadableMediaMessageProtocolEntity.fromFilePath(file_path, url, self.MEDIA_TYPE, ip, to)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_media/protocolentities/message_media_downloadable_video.py", line 137, in fromFilePath
ip, to, mimeType, preview)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_media/protocolentities/message_media_downloadable.py", line 142, in fromFilePath
return DownloadableMediaMessageProtocolEntity(mediaType, mimeType, filehash, url, ip, size, fileName, to = to, preview = preview)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_media/protocolentities/message_media_downloadable.py", line 35, in init
super(DownloadableMediaMessageProtocolEntity, self).init(mediaType, _id, _from, to, notify, timestamp, participant, preview, offline, retry)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_media/protocolentities/message_media.py", line 104, in init
super(MediaMessageProtocolEntity, self).init("media", _id, _from, to, notify, timestamp, participant, offline, retry)
File "build/bdist.linux-x86_64/egg/yowsup/layers/protocol_messages/protocolentities/message.py", line 13, in init
assert (to or _from), "Must specify either to or _from jids to create the message"
AssertionError: Must specify either to or _from jids to create the message
server.py [INFO][2016-04-15 15:17:36,305] Restarting..

abinash111 commented 8 years ago

Offtopic:

How did you get it to work? Can you guide us please?

guyschlider commented 8 years ago

@abinash111 - Its related to the yowsup version you are using. the param order is different. just look at the error and debug it.