This commit is contained in:
yasir 2023-02-15 14:36:18 +07:00
parent e163a2c60e
commit f8198e61a2

View file

@ -82,21 +82,21 @@ async def telegram_mediainfo(client, message):
if int(size) <= 50000000: if int(size) <= 50000000:
c_time = time.time() c_time = time.time()
await message.download( await replymsg.download(
os.path.join(os.getcwd(), filename), os.path.join(os.getcwd(), filename),
progress=progress_for_pyrogram, progress=progress_for_pyrogram,
progress_args=("Trying to download..", reply_msg, c_time) progress_args=("Trying to download..", reply_msg, c_time)
) )
else: else:
async for chunk in client.stream_media(message, limit=5): async for chunk in client.stream_media(replymsg, limit=5):
with open(filename, 'ab') as f: with open(filename, 'ab') as f:
f.write(chunk) f.write(chunk)
try: try:
output_ = await runcmd(f'mediainfo "{filename}"') output_ = await runcmd(f'mediainfo "{filename}"')
out = output_[0] if len(output_) != 0 else None out = output_[0] if len(output_) != 0 else None
file_info = get_file_id(message.reply_to_message) file_info = get_file_id(replymsg)
content = f""" content = f"""
MissKatyBot MediaInfo MissKatyBot MediaInfo
JSON JSON