This commit is contained in:
yasirarism 2023-06-06 15:37:12 +00:00 committed by GitHub
parent 5b1c78c529
commit 7cfad4e76a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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