From 4fb6d50f2b3fed752956a7570d8e8d7a046ce843 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Sat, 20 Apr 2024 19:17:38 -0600 Subject: [PATCH] Mods --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7ceb224..0feab22 100644 --- a/main.py +++ b/main.py @@ -683,7 +683,13 @@ async def upload(path, room_id): url = "https://deek.chat/message/send/" + str(room_id) data = aiohttp.FormData() - data.add_field(name="files[]", value=open(path, "rb"), filename=path.name, content_type=f"image/{ext}") + + if ext in ["webm", "mp4"]: + ctype = f"video/{ext}" + else: + ctype = f"image/{ext}" + + data.add_field(name="files[]", value=open(path, "rb"), filename=path.name, content_type=ctype) try: async with aiohttp.ClientSession(cookies=cookies) as sess: