From 9a6dc7022654d63ebc6f06b042831563b4d982ab Mon Sep 17 00:00:00 2001 From: Someone Date: Fri, 22 Apr 2022 00:03:20 +0200 Subject: [PATCH] modules/WSConvertWebp.py --- modules/WSConvertWebp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/WSConvertWebp.py b/modules/WSConvertWebp.py index 3db518e..6e6d24f 100644 --- a/modules/WSConvertWebp.py +++ b/modules/WSConvertWebp.py @@ -21,7 +21,7 @@ class WSConvertWebp(AbstractWSHandler): with tempfile.TemporaryDirectory() as tmpdirname: tempfilenames = [] for mmfile in post["metadata"]["files"]: - if mmfile["mime_type"] == "image/webp": + if mmfile["mime_type"] in ["image/webp", "invalid-image/webp"]: res = self.bot.api.get_file(mmfile["id"]) with open(tmpdirname+"/"+mmfile["id"]+".webp", 'wb') as tmpfile: tmpfile.write(res.content) @@ -33,5 +33,5 @@ class WSConvertWebp(AbstractWSHandler): root_id = post["id"] if post["root_id"] != "": root_id = post["root_id"] - self.bot.api.create_post(post['channel_id'], "Let me convert that for you", props={"from_webhook":"true"}, filepaths=tempfilenames, root_id=root_id) + self.bot.api.create_post(post['channel_id'], "Let me convert that webp for you", props={"from_webhook":"true"}, filepaths=tempfilenames, root_id=root_id) return True -- 2.43.0