Skip to content

Commit

Permalink
Fixed log message issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Itz-fork committed Aug 15, 2022
1 parent 223548c commit 8bf4374
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion unzipper/modules/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def unzipper_cb(_, query: CallbackQuery, texts):
# Makes download dir
makedirs(download_path)
# Send logs
await unzip_client.send_message(Config.LOGS_CHANNEL, texts["log"].format(user_id, url, fsize))
await unzip_client.send_message(Config.LOGS_CHANNEL, texts["log"].format(user_id, "N/A", "N/A", url, fsize))
s_time = time()
arc_name = f"{download_path}/archive_from_{user_id}_{path.basename(url)}"
await Downloader().download(url, arc_name, query.message)
Expand Down
15 changes: 13 additions & 2 deletions unzipper/modules/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,22 @@ async def extract_dis_archive(_, message: Message, texts):
cleng = (await ses.head(message.text)).headers.get("Content-Length")
fsize = humanbytes(cleng) if cleng else "undefined"
# Send logs
await unzip_client.send_message(Config.LOGS_CHANNEL, texts["log"].format(user_id, file_name, fsize))
await unzip_client.send_message(Config.LOGS_CHANNEL, texts["log"].format(
user_id,
"N/A",
"N/A",
file_name,
fsize)
)
await Downloader().download(message.text, arc_name, unzip_msg)
else:
# Send logs
await unzip_client.send_message(Config.LOGS_CHANNEL, texts["log"].format(user_id, file_name, humanbytes(is_doc.file_size)))
await unzip_client.send_message(Config.LOGS_CHANNEL, texts["log"].format(
user_id,
message.forward_from_chat.title,
message.forward_from_chat.id, file_name,
humanbytes(is_doc.file_size))
)
await message.download(
file_name=arc_name,
progress=progress_for_pyrogram, progress_args=(
Expand Down

0 comments on commit 8bf4374

Please sign in to comment.