Skip to content

Commit

Permalink
Update youtube_dl_button.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Tellybots authored Mar 10, 2022
1 parent 6db9cec commit 9186d5a
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions plugins/youtube_dl_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,35 @@ async def youtube_dl_call_back(bot, update):
logger.info("Did this happen? :\\")
end_two = datetime.now()
time_taken_for_upload = (end_two - end_one).seconds
try:
shutil.rmtree(tmp_directory_for_each_user)
os.remove(thumbnail)
except:
pass
await bot.edit_message_text(
text=Translation.AFTER_SUCCESSFUL_UPLOAD_MSG_WITH_TS.format(time_taken_for_download, time_taken_for_upload),
chat_id=update.message.chat.id,
message_id=update.message.message_id,
disable_web_page_preview=True
)
media_album_p = []
if (await db.get_generate_ss(update.from_user.id)) is True:
if images is not None:
i = 0
caption = ""
if is_w_f:
caption = ""
for image in images:
if os.path.exists(image):
if i == 0:
media_album_p.append(
InputMediaPhoto(
media=image,
caption=caption,
parse_mode="html"
)
)
else:
media_album_p.append(
InputMediaPhoto(
media=image
)
)
i = i + 1
await bot.send_media_group(
chat_id=update.message.chat.id,
disable_notification=True,
reply_to_message_id=update.message.message_id,
media=media_album_p
)


0 comments on commit 9186d5a

Please sign in to comment.