You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have figured out a solution for images, we need to supply rewrite this function as
async def download_secret_media(self, message):
if not message.file or not isinstance(message.file, EncryptedFile):
return b""
key_fingerprint = message.file.key_fingerprint
key = message.media.key
iv = message.media.iv
digest = md5(key + iv).digest()
fingerprint = int.from_bytes(digest[:4], byteorder="little", signed=True) ^ int.from_bytes(digest[4:8],
byteorder="little",
signed=True)
if fingerprint != key_fingerprint:
raise SecurityError("Wrong fingerprint")
media = await self.client.download_file(InputEncryptedFileLocation(message.file.id, message.file.access_hash),
part_size_kb=512, # here we need to give part_size
key=message.media.key,
iv=message.media.iv)
return media
for small size image this thing works but for larger size it fails
The text was updated successfully, but these errors were encountered: