stv0g / transwhat

A gateway between the XMPP and the WhatsApp IM networks
https://dev.0l.de/wiki/projects/transwhat/
GNU General Public License v3.0
122 stars 25 forks source link

Download of encrypted media to local directory and provide a link to it #54

Closed dazzzl closed 7 years ago

dazzzl commented 8 years ago

I played with a combination of tgalal's latest yowsup version and jlguardi's. You find that in my repo. For this a made an experimental Transwhat, which fixed the Unicode bug and download encrypted images. However, it is very dirty and it would be good if we would read the server path and URL from the Transwhat config. Spectrum support this for libpurple backends, like facebook. Even if youwsup is changing the api , we need such a kind of downloading to the local server.

stv0g commented 8 years ago

Hi @dazzzl!

What do you think about using XEP-0363 for the decrypted media contents?

Most people are using Prosody or ejabberd which are providing support for this XEP:

dazzzl commented 8 years ago

This would be a possibility. However, the support of http_upload is then required. Not all server installation provide this. Furthermore, it is more complicated to implement this.

stv0g commented 8 years ago

Sure, I agree.

Is there support from Spectrum to send media as payload of an XMPP stanza? I know that there are some other XEPs (Jingle?) which standardize something like that.

But http_upload has several advantages over those..

moyamo commented 8 years ago

We could use something like SimpleHTTPServer to serve http from the transwhat server.

stv0g commented 8 years ago

:-/ I don't like to make transwhat more complex with things like that.

In my opinion the HTTP Upload XEP is the way to go. Alternatively, Spectrum also supports file transfers. So we could transfer the image this way..

moyamo commented 8 years ago

I don't think spectrum supports file transfer.

stv0g commented 8 years ago

See https://github.com/hanzz/spectrum2/blob/master/plugin/python/NetworkPlugin.py#L187

moyamo commented 8 years ago

Last time I checked that was broken, but maybe they fixed it. I will ask on the chat room.

dazzzl commented 8 years ago

My suggestion was the usage of this feature...

http://spectrum.im/documentation/configuration/web_storage.html

we have to read out the transport config and store the file in the corresponding directory and provide the corresponding link ...

moyamo commented 8 years ago

Do we have to run our own webserver?

moyamo commented 8 years ago

I wrote a parser for the configuration file. #56

stv0g commented 8 years ago

I would make it optional. Maybe by using another entry in the config.

What do you think about using the [transwhat] section for that:

[transwhat]
enable_httpd = 1
dazzzl commented 8 years ago

Download encrypted images to the web storage folder:

https://github.com/dazzzl/transwhat

I haven't tested it completely ... but, what do you think?

stv0g commented 7 years ago

I merged your improvements in a1b8cf0ca91022fe6f59df82dd71bae7ed5a9e4a