Skip to content

Commit

Permalink
do not show file size in the Official Mobile Applications 😁 (UsergeTe…
Browse files Browse the repository at this point in the history
…am#75)

audio files, do not show file size in the Official Mobile Applications.
Ref: https://t.me/c/1341570295/70414
  • Loading branch information
SpEcHiDe authored Jun 21, 2020
1 parent 6bf0b7c commit 7af37c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion userge/plugins/misc/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ async def audio_upload(chat_id, path, del_path: bool):
message: Message = await userge.send_message(
chat_id, f"`Uploading {path.name} as audio ...`")
strpath = str(path)
file_size = humanbytes(os.stat(strpath).st_size)
start_t = datetime.now()
c_time = time.time()
thumb = await get_thumb()
Expand All @@ -283,11 +284,14 @@ async def audio_upload(chat_id, path, del_path: bool):
artist = metadata.get("artist")
await userge.send_chat_action(chat_id, "upload_audio")
try:
audio_caption = ""
audio_caption += f"{path.name} "
audio_caption += f"[ {file_size} ]"
msg = await userge.send_audio(
chat_id=chat_id,
audio=strpath,
thumb=thumb,
caption=path.name,
caption=audio_caption,
title=title,
performer=artist,
duration=metadata.get("duration").seconds,
Expand Down

0 comments on commit 7af37c6

Please sign in to comment.