minor-fix

Signed-off-by: anas <e.anastayyar@gmail.com>
This commit is contained in:
anas 2021-09-23 13:48:11 +03:00
parent 9eb2137e9f
commit 4ce63c3863
3 changed files with 7 additions and 4 deletions

View File

@ -160,7 +160,7 @@ def take_ss(video_file, duration):
des_dir = 'Thumbnails'
if not os.path.exists(des_dir):
os.mkdir(des_dir)
des_dir = os.path.join(des_dir, f"{round(time.time())}.jpg")
des_dir = os.path.join(des_dir, f"{time.time()}.jpg")
duration = int(duration) / 2
subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-ss", str(duration),
"-i", video_file, "-vframes", "1", des_dir])

View File

@ -77,6 +77,7 @@ class TgUploader:
self.sent_msg = self.sent_msg.reply_video(video=up_path,
quote=True,
caption=cap_mono,
parse_mode="html",
duration=duration,
width=width,
height=height,
@ -95,6 +96,7 @@ class TgUploader:
self.sent_msg = self.sent_msg.reply_audio(audio=up_path,
quote=True,
caption=cap_mono,
parse_mode="html",
duration=duration,
performer=artist,
title=title,
@ -105,7 +107,7 @@ class TgUploader:
self.sent_msg = self.sent_msg.reply_photo(photo=up_path,
quote=True,
caption=cap_mono,
supports_streaming=True,
parse_mode="html",
disable_notification=True,
progress=self.upload_progress)
else:
@ -115,6 +117,7 @@ class TgUploader:
quote=True,
thumb=thumb,
caption=cap_mono,
parse_mode="html",
disable_notification=True,
progress=self.upload_progress)
except FloodWait as f:

View File

@ -204,11 +204,11 @@ class MirrorListener(listeners.MirrorListeners):
uname = f'<a href="tg://user?id={self.message.from_user.id}">{self.message.from_user.first_name}</a>'
chat_id = str(self.message.chat.id)
count = len(files)
if OWNER_ID == int(chat_id):
if OWNER_ID == int(chat_id) and count != 1:
msg = f'<b>Name:</b> <code>{link}</code>\n'
msg += f'<b>Total Files:</b> {count}'
sendMessage(msg, self.bot, self.update)
else:
elif count != 1:
chat_id = chat_id[4:]
msg = f"<b>Name:</b> <a href='https://t.me/c/{chat_id}/{self.uid}'>{link}</a>\n"
msg += f'<b>Total Files:</b> {count}\n'