fix: removed progress hooks

This commit is contained in:
Seaswimmer 2023-08-01 12:32:12 -04:00
parent 96f3273593
commit fb6a12311b
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -44,12 +44,8 @@ class MusicDownloader(commands.Cog):
def error(self, msg): def error(self, msg):
print(msg) print(msg)
message.edit(msg) message.edit(msg)
async def hook(d):
if d['status'] == 'finished':
await message.edit(content='YouTube Downloader completed!')
ydl_opts = { ydl_opts = {
'logger': Logger(), 'logger': Logger(),
'progress_hooks': [hook],
'format': 'm4a/bestaudio/best', 'format': 'm4a/bestaudio/best',
'postprocessors': [{'key': 'FFmpegExtractAudio', 'preferredcodec': 'm4a',}], 'postprocessors': [{'key': 'FFmpegExtractAudio', 'preferredcodec': 'm4a',}],
'paths': {'home': path}, 'paths': {'home': path},
@ -95,4 +91,4 @@ class MusicDownloader(commands.Cog):
full_filename = os.path.join(data_path, filename) full_filename = os.path.join(data_path, filename)
if os.path.isfile(full_filename): if os.path.isfile(full_filename):
with open(full_filename, 'rb') as file: with open(full_filename, 'rb') as file:
await ctx.send(content="Downloaded file:", file=discord.File(file, {filename})) await ctx.send(content="YouTube Downloader completed!\nDownloaded file:", file=discord.File(file, {filename}))