-
-
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
Send media - Request upload for file [email protected] failed [BOUNTY FOR SOLUTION] #2149
Comments
I too have same problem. |
I have the same problem, looks like a problem where whatsapp changed their method.. |
Just solved part of the issue: The tag is no longer supported. Now you must send encrypted images with <encr_media>. If you make the needed changes in iq_requestupload.py and iq_requestupload_result.py (replace "media" with "encr_media", you can get to the upload step. I could not, however, get the upload to actually work. Server always gives 400 error. Maybe the server checks if the image is actually encrypted? Gotta check some of the forks which can actually decrypt the image to see if we can figure out a procedure for encryption. I'm trying to get the correct POST format from the decompiled java source, with no success. If anyone has any idea how to proceed, I'd be immensely grateful. |
Glad to hear that someone is trying to do something, now I know that is needed to send encryped media, instead of plain text media, as lguardi commented on
I'm looking forward to understand more about encrypted protocol in yowsup, to actually do something about send encrypted media protocol, I will be glad to any help given. |
@etinin , i follow you to change "media" to "encr_media", got the upload URL, but then got this post & response: POST: HEADER & FOOTER: [email protected] RESPONSE: It seems enc image is send in the protobuf message, like when extracted image from receiving image. |
I'm currently short of the required time, but if someone could take a look at jiguardi's fork, this might be solved. As I understand it, his fork has the decryption method properly implemented. https://github.com/jlguardi/yowsup/tree/master/yowsup In a parallel note, maybe we could try uploading a pre-encrypted image file? As I understand, the server should probably accept it, since it doesn't really have the key. But, again, I haven't studied the proper code. It seems you just have to send yourself an encrypted image and check the specifics of the AES encryption being employed. I've tried intercepting the whatsapp app requests to solve this issue but it's harder than I believed. The APP both on iPhone and Android seems to ignore proxy settings entirely when it can connect straight to the internet. And even some requests that get through the proxy are closed by Whatsapp when the app sees the selfsigned SSL certificate (even though the cert is properly added to the system. Anyone has knowledge any reliable procedure for intercepting requests? Med school is keeping me way too busy to keep working blindly. |
I made some modifications, to send back received image with enc, This my debug log: [message to="[email protected]" type="media" id="1500356450-2"] 2017-07-18 12:40:51,414 [MainThread ] [DEBUG] rx: 2017-07-18 12:40:52,778 [MainThread ] [DEBUG] rx: 2017-07-18 12:40:52,779 [MainThread ] [DEBUG] tx: |
@bahtiarp, you've got to properly encrypt the image and send the encryption key. Could you please send the patch? |
This is how to encrypt:
refkey = binascii.hexlify(os.urandom(112)) |
Where should this be? In mediauploader.py after "stream = f.read()" ? I got this error: global name pad is not defined. Should I also change the media-tag to encr_media ? |
@dietzi try this
|
Here is my diff: https://pastebin.com/mWvjhSUX |
try this:
|
If you see the log, you got this when you upload the data: RESPONSE: (so you dont get the json data, as expected by the next processed). I've checked from wa web version (chrome). I see the header when uploading encr image is diffrent from yowsup mediauploader done. yowsup mediauploader.py version for Header POST: POST https://mmg.whatsapp.net/u/f/Gqp_7Z4ZN1PsLrg8b3xHGllraQYABVRvM1QKAg/AkObQlFqUS5DA21KPJHyYOnL47WKzVMSGN8Jf0SaiBE8 --zzXXzzYYzzXXzzQQ [email protected] [email protected] Response from Whatsapp: Whatsapp WEB (chrome) version for Header POST: ------WebKitFormBoundary83mOQO9W0A1qhgX7 xxfuy7CpXoeRjSI321m74C8sXG/u3Bls8niwzzdGxuE= UL9-EipnOTCQuDjlaN-C5_pwW5k= Whatsapp WEB (chrome) RESPONSE: i've checked that this: xxfuy7CpXoeRjSI321m74C8sXG/u3Bls8niwzzdGxuE= is the b64Hash of image file. While this two (Content-Disposition: form-data; name="refs"): But although we got the correct response from whatsapp when uploaded, we have totally have to change the next process in yowsup. because it's diffrent from old responses that yowsup processed. |
@bahtiarp The refs is generated using the send number and recipient number with encripty:
|
If I add "hash" to the header with a random key then I get "unsupported media type". I think if we could get the hash-code then we will be able to send media. Does anybody know about to generate the hash? |
@pabloruan0710 from: 62851xxxxxx refs should be: UL9-EipnOTCQuDjlaN-C5_pwW5k= can you try to get the same result with your js script? |
@bahtiarp This numbers ref is random Cripty, not is same number, check post with sniffer in Whatsapp web. |
I can Send, and received this response:
However didn't received image in recipient number |
@pabloruan0710 Have you sent ProtocolMedia message to the recipient? Or you have just uploaded the file. |
@pabloruan0710 What did you do with refs? Did you encrypt sender and recipient respectively? |
@pabloruan0710 great you've succeed to upload the image and get the response. (i still figuring out how to get the "refs" correct. unless you show the code :) ) The next step is like @jlguardi said, you have todo some modification in protocol media (toProtocolTreeNode), so the message will send in the following protobuf format: [message to="[email protected]" type="media" id="1500356450-2"] where DATA consist (encrypted) of: |
sorry for my bad english. @bahtiarp i can send the media message (without encrypt img) and response similar like @pabloruan0710 , the recipient never received the message. But if i send the encrypted image, always return 400 bad request.
How to encrypt image properly? |
@whyasta I think you're getting "400 bad request" because the length of encrypted file isn't the same from the raw file, so your "filesize" needs to be equal "len(stream)". |
It's seems that that your Content-Length is based on file before encrypted. This is how i fixed it:
Now we can continue to fixing the next process. |
@bahtiarp did you get to successfully upload the file? I'm stopped on an error saying "415 Unsupported Media Type" |
@duzzifelipe POST https://mmg.whatsapp.net/u/f/ctq7Cm2nDwGv6rv1jqGWdlmMe7gABVZn2tCVcQ/AmJ99kyxGcMaIS1BkYC8vyFDFmPPbXQ779hJKmhWMCZL --zzXXzzYYzzXXzzQQ NCzF2z0pL8F+zAN41s/MFiJPOrL4yi0cNMmCsWSHc6w= bsD9smTr55H5ifQkU3xd+F1Webo= RESPONSE: {"type":"encrypted","mimetype":"application/octet-stream","size":"7034","filehash":"NCzF2z0pL8F+zAN41s/MFiJPOrL4yi0cNMmCsWSHc6w=","url":"https://mmg-fna.whatsapp.net/d/f/AtOdjxzg-CAUEi-2LL_uepNfYNquO9rIItlkp-uKRngh.enc"} As you can see: |
@aarcwb For more details see: https://help.github.com/articles/creating-a-pull-request-from-a-fork/ If you need any assitance jump on our discord: https://discord.gg/Wa7QSxZ |
whatsapp blocks my numbers is there any solution for this? |
Do not send messages to contacts that havent been sync |
@AragurDEV I think that I made the pull request correctly, please let me know if I forget to do something. |
@aarcwb yes i saw it. Just read what i wrote there |
Is there a limit to different numbers to which a message can be sent? |
@AragurDEV and @aarcwb , first, i found issue about pyopen (then i fixed reinstall OpenSSH). ##2149 (comment) how can i fixed that ? |
@Mantauwhite I need more details about your code, but at least for me, the simple code below I am able to receive image:
|
aragurdev/yowsup is working fine for sending text and images. I've just used it. |
@aarcwb hello,I can send and receive image now,thanks so much, and how to get the image from file.enc? |
@ykguCoder see the getMediaContent method code, there the image/video/audio are decrypted from file.enc url. |
@aarcwb Thank you so much,work fine. |
why my phone number blocked when I receiving messages? |
media_url contains url from column media_url, media_enc_hash contains base-64 string from media_enc_hash and also media_wa_type contains int from media_wa_type. |
Still no images, not even an errormessage.
documents could be send installed from https://github.com/AragurDEV/yowsup please help |
Can someone please help me with this: |
Hi, Since last week , if i register new number, I always get : Is there any body now get the same messages when registering new number? Is there any solutions for this ? Thanks. |
Anyone have this working yet? |
Yes it is working, Just keep your environment clean. I mean server and libraries especially python -axolotol. |
@naushrambo just cloned this repo and installed, same issue as above request error |
me too |
is anyone able to send audio, video, document with the AragurDEV fork? is anyone able to receive media files? I see the message, but the media file is still encrypted. I saw posts that people are able to receive media, but can't get it work. |
All of my numbers is blocked today, is this because the end of whatsapp support for S40? |
I get "Login Failed, reason: not-authorized" :-( |
Hello I'm trying to upload media by yowsup, using
RequestUploadIqProtocolEntity
but it's not possible because lambda function allways direct toonRequestUploadError
, and cant send file ...Request upload for file /tmp/jpeg.jpg for [email protected] failed
I also tried with yowsupCLI using image send
/image send 5524XXXXXX /tmp/3DCDA9A9436B01F9A3.jfif
The text was updated successfully, but these errors were encountered: