diff --git a/src/cogs/ffmeta.py b/src/cogs/ffmeta.py index 4ae020a..70a5ffa 100644 --- a/src/cogs/ffmeta.py +++ b/src/cogs/ffmeta.py @@ -229,7 +229,7 @@ class FFMeta(commands.Cog): return await ctx.respond(file=discord.File(file, filename=filename)) paginator = commands.Paginator() - for line in stderr.splitlines(): + for line in stderr.decode().splitlines(): if line.strip().startswith(":"): continue paginator.add_line(f"{line}"[:2000]) @@ -240,7 +240,8 @@ class FFMeta(commands.Cog): @commands.slash_command(name="right-behind-you") async def right_behind_you(self, ctx: discord.ApplicationContext, image: discord.Attachment): await ctx.defer() - if not Path("assets/right-behind-you.ogg").exists(): + rbh = Path("assets/right-behind-you.ogg").resolve() + if not rbh.exists(): return await ctx.respond("The file `right-behind-you.ogg` is missing.") if not image.content_type.startswith("image"): return await ctx.respond("That's not an image!") @@ -257,7 +258,7 @@ class FFMeta(commands.Cog): "-i", temp.name, "-i", - "assets/right-behind-you.ogg", + str(rbh), "-c:v", "libx264", "-tune", @@ -279,7 +280,7 @@ class FFMeta(commands.Cog): else: return await ctx.respond(file=discord.File(file, filename="right-behind-you.mp4")) paginator = commands.Paginator() - for line in stderr.splitlines(): + for line in stderr.decode().splitlines(): if line.strip().startswith(":"): continue paginator.add_line(f"{line}"[:2000])