Aragur / yowsup

The python WhatsApp library
https://discord.gg/Wa7QSxZ
GNU General Public License v3.0
56 stars 22 forks source link

How to save image decrypted in the file system? #10

Open PedroFcul opened 6 years ago

PedroFcul commented 6 years ago

i can receive messages in format media with your code and i get this output

[Media Type:image, Size:286168, URL:b'https://mmg.whatsapp.net/d/f/..........enc']

now how do i decrypt and download the image into my filesystem?

hoehermann commented 6 years ago

jlguardi's fork features the getMediaContent method. As I recall, it was never merged into tgalal's repository and therefore is missing in this one. Please mind that this implementation of media decryption has been observed to be unreliable, especially in group chats.

PedroFcul commented 6 years ago

ok i've done it, but it doesn't work on any other files (ex: .txt), is there a way to decrypt and download files?

hgc2002 commented 6 years ago

same here. it would be great to been able to test it in the command line also before entering to add more code.

mikesalmonuk commented 6 years ago

This should be working if you checkout the latest code. The PR from a couple of weeks ago added this, all media is now saved to /tmp/yowfiles/ folder.

pabloruan0710 commented 6 years ago

@PedroFcul work for you? For me working ok. close the issue if ok

markus7017 commented 5 years ago

Using AragurDEV's latest build I tried various format. This is my result Text in: ok Text out: ok

Image in: message received, but url points to encrypted filed Image out: ok

Video in: Message is received, but attachment is encrypted Video out: nothing happens

Audio in: Message is received, but attachment is encrypted Audio out: not yet tested

Document in: nothing happens .txt: “[Media Type: document]” is received, but no additional information (e.g. url)

Docoument out: pdf: “Exception: Unable to get page count. Is poppler installed and in PATH?” popler installed with “brew install poppler” -> ok Localtion out: ok Location in: Message MediaType: location, but no other information

VCard out: ok VCard in: “[Media Type: document]”, but no other information

--

So in genereal the incoming files will show as .enc and are not automatically decrypted. Is there anything I'm missing?

Aragur commented 5 years ago

@markus7017 You are right.
Encryption of incoming media is still not implemented yet.

markus7017 commented 5 years ago

Do you know this link? https://www.quora.com/How-can-I-decrypt-an-encrypted-WhatsApp-file

There is a program by AndreasM, which at least can decrypt database file: https://www.quora.com/How-do-you-decrypt-WhatsApp-message-files. Would that help?

I have another question. Does you repo include all/most available patches? It seems that the master repo is no linger maintained.

fyi: I’m working on a WhatsApp binding for openHAB V2 (ome automation) based on yowsup. I already switched to your fork :-) https://community.openhab.org/t/whatsapp-aka-yowsup-helper-functions/12517/34?u=markus7017