diff --git a/app/plugins/files/download.py b/app/plugins/files/download.py index 3e68564..fb4ec1d 100644 --- a/app/plugins/files/download.py +++ b/app/plugins/files/download.py @@ -30,7 +30,7 @@ async def down_load(bot: BOT, message: Message): file_name = None if message.replied and message.replied.media: if "-f" in message.flags: - file_name = message.input + file_name = message.flt_input download_coro = telegram_download( message=message.replied, response=response, @@ -41,7 +41,7 @@ async def down_load(bot: BOT, message: Message): if "-f" in message.flags: file_name, url = message.flt_input.split() else: - file_name, url = None, message.input + url = message.flt_input dl_obj: Download = await Download.setup( url=url, path=dl_path, message_to_edit=response, custom_file_name=file_name ) diff --git a/app/plugins/files/rename.py b/app/plugins/files/rename.py index 1f722c6..7ab5f2d 100644 --- a/app/plugins/files/rename.py +++ b/app/plugins/files/rename.py @@ -1,5 +1,6 @@ import asyncio import os +import shutil import time from app import BOT, bot @@ -59,6 +60,7 @@ async def rename(bot: BOT, message: Message): progress_args=progress_args, **media["kwargs"] ) + shutil.rmtree(dl_path, ignore_errors=True) await response.delete() except asyncio.exceptions.CancelledError: await response.edit("Cancelled....")