Fix missing key error in yt-dl

This commit is contained in:
Nexus 2023-06-01 01:09:05 +01:00
parent 42367b0514
commit 485061bb49
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -143,11 +143,11 @@ class OtherCog(commands.Cog):
"id": fmt["format_id"], "id": fmt["format_id"],
"ext": fmt["ext"], "ext": fmt["ext"],
"protocol": fmt["protocol"], "protocol": fmt["protocol"],
"acodec": fmt["acodec"], "acodec": fmt.get("acodec", "?"),
"vcodec": fmt["vcodec"], "vcodec": fmt.get("vcodec", "?"),
"resolution": fmt["resolution"], "resolution": fmt.get("resolution", "?x?"),
"filesize": fmt.get("filesize", float('inf')), "filesize": fmt.get("filesize", float('inf')),
"format": fmt["format"], "format": fmt.get("format", '?'),
} }
for fmt in info["formats"] for fmt in info["formats"]
} }
@ -928,7 +928,8 @@ class OtherCog(commands.Cog):
title="Error", title="Error",
description="Invalid format %r. pass `list-formats:True` to see a list of formats." % _fmt, description="Invalid format %r. pass `list-formats:True` to see a list of formats." % _fmt,
colour=discord.Colour.red() colour=discord.Colour.red()
) ),
delete_after=30
) )
MAX_SIZE_MB = ctx.guild.filesize_limit / 1024 / 1024 MAX_SIZE_MB = ctx.guild.filesize_limit / 1024 / 1024
@ -1015,7 +1016,8 @@ class OtherCog(commands.Cog):
title="Error", title="Error",
description=f"Download failed:\n```\n{e}\n```", description=f"Download failed:\n```\n{e}\n```",
colour=discord.Colour.red() colour=discord.Colour.red()
) ),
delete_after=30
) )
else: else:
embed = discord.Embed( embed = discord.Embed(