From 2ee127bce2012e6eb694c72747192fc703b4e37d Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Mon, 17 Jun 2024 20:11:44 +0100 Subject: [PATCH] Fix ytdl --- src/cogs/ytdl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cogs/ytdl.py b/src/cogs/ytdl.py index d73c673..df232cc 100644 --- a/src/cogs/ytdl.py +++ b/src/cogs/ytdl.py @@ -485,7 +485,7 @@ class YTDLCog(commands.Cog): await ctx.edit(view=None) try: if audio_only is False: - file: Path = next(temp_dir.glob("*." + extracted_info["ext"])) + file: Path = next(temp_dir.glob("*." + extracted_info.get("ext", "*"))) else: # can be .opus, .m4a, .mp3, .ogg, .oga for _file in temp_dir.iterdir(): @@ -495,7 +495,7 @@ class YTDLCog(commands.Cog): else: raise StopIteration except StopIteration: - ext = extracted_info["ext"] + ext = extracted_info.get("ext", "*") self.log.warning( "Failed to locate downloaded file. Was supposed to be looking for a file extension of " "%r amongst files %r, however none were found.",