From 51048df4f69bd7a82dafcd6fada09c1b60d1bfa1 Mon Sep 17 00:00:00 2001 From: Hash Minner <86665964+kalanakt@users.noreply.github.com> Date: Thu, 11 Aug 2022 00:09:09 +0530 Subject: [PATCH] bug fix --- Uploader/button.py | 6 +++--- Uploader/commands.py | 23 ----------------------- Uploader/dl_button.py | 14 +++++++------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/Uploader/button.py b/Uploader/button.py index a08f9c5b..be90da95 100644 --- a/Uploader/button.py +++ b/Uploader/button.py @@ -77,9 +77,9 @@ async def youtube_dl_call_back(bot, update): if entity.type == "text_link": youtube_dl_url = entity.url elif entity.type == "url": - o = entity.offset - l = entity.length - youtube_dl_url = youtube_dl_url[o:o + l] + offset = entity.offset + length = entity.length + youtube_dl_url = youtube_dl_url[offset:offset + length] if youtube_dl_url is not None: youtube_dl_url = youtube_dl_url.strip() if custom_file_name is not None: diff --git a/Uploader/commands.py b/Uploader/commands.py index d989cbdc..af25f834 100644 --- a/Uploader/commands.py +++ b/Uploader/commands.py @@ -58,26 +58,3 @@ async def aboutme(_, m: Message): reply_markup=Translation.ABOUT_BUTTONS, disable_web_page_preview=True, ) - - -@Client.on_message( - filters.private & filters.reply & filters.text -) -async def edit_caption(bot, update): - try: - await bot.send_cached_media( - chat_id=update.chat.id, - file_id=update.reply_to_message.video.file_id, - reply_to_message_id=update.id, - caption=update.text - ) - except: - try: - await bot.send_cached_media( - chat_id=update.chat.id, - file_id=update.reply_to_message.document.file_id, - reply_to_message_id=update.id, - caption=update.text - ) - except: - pass diff --git a/Uploader/dl_button.py b/Uploader/dl_button.py index 5915c3da..b78d3bed 100644 --- a/Uploader/dl_button.py +++ b/Uploader/dl_button.py @@ -60,9 +60,9 @@ async def ddl_call_back(bot, update): if entity.type == "text_link": youtube_dl_url = entity.url elif entity.type == "url": - o = entity.offset - l = entity.length - youtube_dl_url = youtube_dl_url[o:o + l] + offset = entity.offset + length = entity.length + youtube_dl_url = youtube_dl_url[offset:offset + length] if youtube_dl_url is not None: youtube_dl_url = youtube_dl_url.strip() if custom_file_name is not None: @@ -73,9 +73,9 @@ async def ddl_call_back(bot, update): if entity.type == "text_link": youtube_dl_url = entity.url elif entity.type == "url": - o = entity.offset - l = entity.length - youtube_dl_url = youtube_dl_url[o:o + l] + offset = entity.offset + length = entity.length + youtube_dl_url = youtube_dl_url[offset:offset + length] description = custom_file_name if f".{youtube_dl_ext}" not in custom_file_name: @@ -223,7 +223,7 @@ async def ddl_call_back(bot, update): try: os.remove(download_directory) os.remove(thumb_image_path) - except: + except Exception: pass time_taken_for_download = (end_one - start).seconds time_taken_for_upload = (end_two - end_one).seconds