From 872b6a723ad07bce731343fd9943ef758effb8d9 Mon Sep 17 00:00:00 2001 From: BlackCatDevel0per Date: Wed, 23 Mar 2022 22:06:27 +0500 Subject: [PATCH] Added tgcrypto lib from pyrogram project --- optional-requirements.txt | 2 ++ readthedocs/basic/installation.rst | 5 +++-- telethon/_client/telegramclient.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/optional-requirements.txt b/optional-requirements.txt index 30326da9..34b50d43 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -1,4 +1,6 @@ +tgcrypto cryptg +pyaesni pysocks python-socks[asyncio] hachoir diff --git a/readthedocs/basic/installation.rst b/readthedocs/basic/installation.rst index 2f8fa8ab..a4fae888 100644 --- a/readthedocs/basic/installation.rst +++ b/readthedocs/basic/installation.rst @@ -51,7 +51,7 @@ The version number of the library should show in the output. Optional Dependencies ===================== -If cryptg_ is installed, **the library will work a lot faster**, since +If tgcrypto_ or cryptg_ or pyaesni(intel aes-ni) is installed, **the library will work a lot faster**, since encryption and decryption will be made in C instead of Python. If your code deals with a lot of updates or you are downloading/uploading a lot of files, you will notice a considerable speed-up (from a hundred kilobytes @@ -83,11 +83,12 @@ manually. apt update apt install clang lib{jpeg-turbo,webp}-dev python{,-dev} zlib-dev pip install -U --user setuptools - pip install -U --user telethon cryptg pillow + pip install -U --user telethon tgcrypto pillow Thanks to `@bb010g`_ for writing down this nice list. +.. _tgcrypto: https://github.com/pyrogram/tgcrypto .. _cryptg: https://github.com/cher-nov/cryptg .. _pyaes: https://github.com/ricmoo/pyaes .. _pillow: https://python-pillow.org diff --git a/telethon/_client/telegramclient.py b/telethon/_client/telegramclient.py index 3d32dd3b..af2e7dbf 100644 --- a/telethon/_client/telegramclient.py +++ b/telethon/_client/telegramclient.py @@ -1676,7 +1676,7 @@ class TelegramClient: Downloads the given media from a message object. Note that if the download is too slow, you should consider installing - ``cryptg`` (through ``pip install cryptg``) so that decrypting the + ``tgcrypto`` (through ``pip install tgcrypto``) so that decrypting the received data is done in C instead of Python (much faster). See also `Message.download_media() `.