Explorar o código

Raise exceptions for bad media download responses

Nick Barrett %!s(int64=2) %!d(string=hai) anos
pai
achega
d89d4434ca
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      mautrix_instagram/portal.py

+ 2 - 2
mautrix_instagram/portal.py

@@ -893,11 +893,11 @@ class Portal(DBPortal, BasePortal):
             return data, mimetype
 
         if self.config["bridge.use_proxy_for_media"]:
-            async with source.client.raw_http_get(url) as resp:
+            async with source.client.raw_http_get(url, raise_for_status=True) as resp:
                 return await handle_resp(resp)
         else:
             async with ClientSession() as session:
-                async with session.get(url) as resp:
+                async with session.get(url, raise_for_status=True) as resp:
                     return await handle_resp(resp)
 
     async def _reupload_instagram_file(