mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-17 13:21:52 +00:00
Merge branch 'master' into docs
This commit is contained in:
commit
d3b82ef622
@ -18,17 +18,18 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import sys
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import socks
|
import socks
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
sys.exit(
|
e.msg = (
|
||||||
"PySocks is missing and Pyrogram can't run without. "
|
"PySocks is missing and Pyrogram can't run without. "
|
||||||
"Please install it using \"pip3 install pysocks\"."
|
"Please install it using \"pip3 install pysocks\"."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
raise e
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
Proxy = namedtuple("Proxy", ["enabled", "hostname", "port", "username", "password"])
|
Proxy = namedtuple("Proxy", ["enabled", "hostname", "port", "username", "password"])
|
||||||
|
@ -16,19 +16,18 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import tgcrypto
|
import tgcrypto
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
sys.exit(
|
e.msg = (
|
||||||
"TgCrypto is missing and Pyrogram can't run without. "
|
"TgCrypto is missing and Pyrogram can't run without. "
|
||||||
"Please install it using \"pip3 install tgcrypto\". "
|
"Please install it using \"pip3 install tgcrypto\". "
|
||||||
"More info: https://docs.pyrogram.ml/resources/TgCrypto"
|
"More info: https://docs.pyrogram.ml/resources/TgCrypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
# TODO: Ugly IFs
|
|
||||||
class AES:
|
class AES:
|
||||||
@classmethod
|
@classmethod
|
||||||
def ige_encrypt(cls, data: bytes, key: bytes, iv: bytes) -> bytes:
|
def ige_encrypt(cls, data: bytes, key: bytes, iv: bytes) -> bytes:
|
||||||
|
Loading…
Reference in New Issue
Block a user