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.",