fix: oops I forgot how tuples work

This commit is contained in:
Seaswimmer 2023-08-01 13:25:07 -04:00
parent 301f9f73c9
commit b4aeaedb3d
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -95,14 +95,14 @@ class MusicDownloader(commands.Cog):
msg = ctx.send
message = await msg("YouTube Downloader started!")
ytdlp_output = youtube_download(self, url, data_path, message)
full_filename = os.path.join(data_path, ytdlp_output[1])
full_filename = os.path.join(data_path, ytdlp_output[0])
while not os.path.isfile(full_filename):
await asyncio.sleep(0.5)
if os.path.isfile(full_filename):
with open(full_filename, 'rb') as file:
complete_message = await ctx.send(content="YouTube Downloader completed!\nDownloaded file:", file=discord.File(file, ytdlp_output[1]))
complete_message = await ctx.send(content="YouTube Downloader completed!\nDownloaded file:", file=discord.File(file, ytdlp_output[0]))
file.close()
if delete is True or await self.bot.is_owner(ctx.user) is False:
if ytdlp_output[2] is False:
if ytdlp_output[1] is False:
os.remove(full_filename)
await complete_message.edit(content="YouTube Downloader completed!\nFile has been deleted from Galaxy.\nDownloaded file:")