Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

Download web files through Telegram

Open Lonami opened this issue 4 years ago • 1 comments

Currently, the library downloads WebDocument and WebDocumentNoProxy in the same way. This however is a security risk, since it allows websites to learn information about the client, such as IP address.

Instead, as explained in Telegram's documentation, the download should be proxied through Telegram's servers to avoid information leakage.

Lonami avatar Sep 12 '19 21:09 Lonami

The solution will need to find a web file to test this on, and then modify the following method:

https://github.com/LonamiWebs/Telethon/blob/5c5cee16d9e1811b5e8c9a11fb89257a0433db5d/telethon/client/downloads.py#L297

If it receives a web document, follow the advice from the official documentation to implement a correct download.

Lonami avatar Oct 01 '20 11:10 Lonami