mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-01 02:39:54 +03:00
Update tcpmtproxy.py
This commit is contained in:
parent
e451970c0f
commit
f0b9503c0b
|
@ -1,4 +1,3 @@
|
||||||
import binascii
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import hashlib
|
import hashlib
|
||||||
import base64
|
import base64
|
||||||
|
@ -140,11 +139,8 @@ class TcpMTProxy(ObfuscatedConnection):
|
||||||
try:
|
try:
|
||||||
secret_bytes = bytes.fromhex(secret)
|
secret_bytes = bytes.fromhex(secret)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
try:
|
secret = secret + '=' * (-len(s) % 4)
|
||||||
secret_bytes = base64.b64decode(secret.encode())
|
secret_bytes = base64.b64decode(secret.encode())
|
||||||
except binascii.Error:
|
|
||||||
secret = secret + "=="
|
|
||||||
secret_bytes = base64.b64decode(secret.encode())
|
|
||||||
|
|
||||||
return secret_bytes[:16] # Remove the domain from the secret (until domain support is added)
|
return secret_bytes[:16] # Remove the domain from the secret (until domain support is added)
|
||||||
|
|
||||||
|
@ -166,4 +162,4 @@ class ConnectionTcpMTProxyRandomizedIntermediate(TcpMTProxy):
|
||||||
"""
|
"""
|
||||||
Connect to proxy using randomized intermediate protocol (dd-secrets)
|
Connect to proxy using randomized intermediate protocol (dd-secrets)
|
||||||
"""
|
"""
|
||||||
packet_codec = RandomizedIntermediatePacketCodec
|
packet_codec = RandomizedIntermediatePacketCodec
|
||||||
|
|
Loading…
Reference in New Issue
Block a user