Properly parse URLs

This commit is contained in:
Nexus 2024-04-19 23:27:02 +01:00
parent 25adb45b50
commit 0ecb651b2d
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -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]