From 7cfad4e76af44b32fee529b1aff1738d8a55f9e8 Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Tue, 6 Jun 2023 15:37:12 +0000 Subject: [PATCH] Fxi --- misskaty/plugins/download_upload.py | 5 ++++- misskaty/plugins/genss.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/misskaty/plugins/download_upload.py b/misskaty/plugins/download_upload.py index 85a55717..f09598d4 100644 --- a/misskaty/plugins/download_upload.py +++ b/misskaty/plugins/download_upload.py @@ -93,7 +93,10 @@ async def download(client, message): custom_file_name = custom_file_name.strip() download_file_path = os.path.join("downloads/", custom_file_name) downloader = SmartDL(url, download_file_path, progress_bar=False, timeout=10) - downloader.start(blocking=False) + try: + downloader.start(blocking=False) + except Exception as err: + return await ctx.edit(str(err)) c_time = time.time() while not downloader.isFinished(): total_length = downloader.filesize or None diff --git a/misskaty/plugins/genss.py b/misskaty/plugins/genss.py index 0b5cabc4..5854c8f5 100644 --- a/misskaty/plugins/genss.py +++ b/misskaty/plugins/genss.py @@ -48,7 +48,10 @@ async def genss(self: Client, ctx: Message, strings): file_name = os.path.basename(url) download_file_path = os.path.join("downloads/", file_name) downloader = SmartDL(url, download_file_path, progress_bar=False, timeout=10) - downloader.start(blocking=False) + try: + downloader.start(blocking=False) + except Exception as err: + return await ctx.edit(str(err)) c_time = time.time() while not downloader.isFinished(): total_length = downloader.filesize or None