-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sending image fail in legacy yowsup-cli #581
Comments
I review the code on connectionmanager.py @medianode
but i don't know the variables, @tgalal, @chirikchik, @debianitram do you know what parameters i need??? Thanks in advance! |
I analize the debug, and this is my unique conclusion From UploaderClient.py the correct execution is:
This part doesn't work or is incomplete (I think that is the second option)
But message_imageSend self.methodInterface.registerCallback("message_imageSend",self.sendImage) and sendImage is not implemented
what I Need for implement the missing code? Thanks! |
At today, I tried change the sendImage method for the final step, but; without documentation is very hard. Do you have some document or can you help me to know the correct attributes? This is the result of my last test: The Code:
The result
|
Analysing the steps, I see these parameters, but i don't know what are the corrects for send
I tried with variations of these ones: mmNode = ProtocolTreeNode("media", {"type":mediaType,"file":name,"size":size,"url":url},None, args[4:][0] if args[4:] else None); ProtocolTreeNode("media", {"type":"location","latitude":latitude,"longitude":longitude},None,preview) |
Hey man, i need to send images through a single command. like ./yowsup-cli -c config -sendimage /path/image.jpg 49999999-99999999 Are you able to modify the code of yowsup? I dont want to login first, then /L then /image send. :s |
No, this issue is for the legacy version, this version can be use in the command line the login information is taken of the configuration file. I like the last program style, i don't review the new version 2.0 with the layers style yet. |
@tgalal, do you have the parameters that i need for this implement, please ??? thanks! |
For sending the uploaded image it's should be something like this: <message t="{{TIME_STAMP}}" from="{{CONTACT_JID}}"
offline="{{OFFLINE}}" type="media" id="{{MESSAGE_ID}}" notify="{{NOTIFY_NAME}}">
<media type="image"
mimetype="{{MIME_TYPE}}"
filehash="{{FILE_HASH}}"
url="{{DOWNLOAD_URL}}"
ip="{{IP}}"
size="{{MEDIA SIZE}}"
file="{{FILENAME}}"
encoding="{{ENCODING}}"
height="{{IMAGE_HEIGHT}}"
width="{{IMAGE_WIDTH}}"
> {{THUMBNAIL_RAWDATA}}
</media>
</message> And so to manually construct something that resolves to this, you should do something like: messageNode = ProtocolTreeNode("message", {"to": jid, "type": "media", ...})
mediaNode = ProtocolTreeNode("media", {"type": "image", "url": url, "mimetype": mimetype, ...}, data = preview) #if you want to send thumbnail/preview
messageNode.addChild(mediaNode) And then send this messageNode. In yowsup's old code, the decorators @sendMessage, @medianode automatically transformed what sendImage function returned into this. |
thanks so much! |
Let me if understand your change, we need two steps for send the image to the smartphone.
My question is: what kind of message we need for send the image in step 2. (text, url, image)
What I need implement for end the module??
I implement the legacy version for my server and I have reports on image format, my idea is send these one's to my wattsapp. Only I need the second step for complete this one.
I review the code but I don't the implementation for the command, I know how can with xml, only need the information for the command of send the image (that I understand the the command for upload is very different for the step 2nd)
morfeokmg
morfeokmg commented 17 days ago
This is my test.
I executed in debug mode.
....
YowsupConnectionManager: starting reader
YowsupConnectionManager: started
Sending picture /home/morfeokmg/watts/Caso1.jpg of size 42781 with name Caso1.jpg
Sending media_requestUpload
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:
......
BinTreeNodeReader: Incoming
BinTreeNodeReader:
Request Dublicate: hash: hsjVxrz8M1Z0J8nNmQAcBph3NIsuU6SDiNl6xiGp6OM= url: https://mmi631.whatsapp.net/d/AubJPvfWLCHP69u3qvJxNxoTVl1N0wNkjuC0mnt4B5t0.jpg
Sending message_image
BinTreeNodeWriter: Outgoing
BinTreeNodeWriter:
796573
BinTreeNodeReader: Incoming
BinTreeNodeReader:
Got request MediaReceipt
Please, I need know what I need modify or implement in the code in the Legacy version!!!!.
Best Regards.
The text was updated successfully, but these errors were encountered: