File tree 1 file changed +17
-0
lines changed 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 13
13
from os import PathLike
14
14
from io import BytesIO
15
15
from time import time
16
+ from traceback import format_exc
16
17
17
18
from inspect import isasyncgen
18
19
from asyncio import iscoroutinefunction , gather
@@ -2086,6 +2087,22 @@ async def import_file(
2086
2087
pf .set_file_id (drbf ._id )
2087
2088
pf .set_upload_time (drbf ._upload_time )
2088
2089
2090
+ updated_metadata = None
2091
+ if drbf ._message .message :
2092
+ try :
2093
+ caption_metadata = urlsafe_b64decode (drbf ._message .message )
2094
+ _ = AES (drbf ._filekey ).decrypt (caption_metadata )
2095
+ _ = PackedAttributes .unpack (_ )
2096
+ updated_metadata = caption_metadata
2097
+ except Exception as e :
2098
+ logger .info (
2099
+ f'Updates to metadata for ID{ drbf ._id } failed. '
2100
+ f'Traceback:\n { format_exc ()} '
2101
+ )
2102
+
2103
+ if updated_metadata :
2104
+ pf .set_updated_enc_metadata (caption_metadata )
2105
+
2089
2106
dlbf = await self ._make_local_file (pf )
2090
2107
2091
2108
if update_metadata :
You can’t perform that action at this time.
0 commit comments