Fix ytdl
All checks were successful
Build and Publish / build_and_publish (push) Successful in 52s

This commit is contained in:
Nexus 2024-06-17 20:11:44 +01:00
parent c40c8294b3
commit 2ee127bce2

View file

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