From 0ecb651b2dc9525800cdacd9845fe1f9254500bf Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Fri, 19 Apr 2024 23:27:02 +0100 Subject: [PATCH] Properly parse URLs --- src/cogs/auto_responder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cogs/auto_responder.py b/src/cogs/auto_responder.py index 80315a4..0677fb4 100644 --- a/src/cogs/auto_responder.py +++ b/src/cogs/auto_responder.py @@ -204,7 +204,8 @@ class AutoResponder(commands.Cog): } # ^ All containers allowed to contain HEVC # per https://en.wikipedia.org/wiki/Comparison_of_video_container_formats - if link.lower().endswith(tuple(hevc_containers)): + parsed = urlparse(link.lower()) + if parsed.path.endswith(tuple(hevc_containers)): self.log.info("Found link to transcode: %r", link) try: async with message.channel.typing(): @@ -262,6 +263,7 @@ class AutoResponder(commands.Cog): if reaction.message.author != self.bot.user: if str(reaction.emoji) == "\N{VIDEOCASSETTE}": + self.log.info("Got VHS reaction, scanning for transcode") extra = [] if reaction.message.attachments: extra = [attachment.url for attachment in reaction.message.attachments]