From 4b8fceecdc2fb733c691c29162aaa8d2118f8e2d Mon Sep 17 00:00:00 2001 From: KNF Apps Date: Mon, 2 Oct 2023 11:34:27 -0600 Subject: [PATCH] fix(client): add FloodWait exception to media download Signed-off-by: wulan17 --- pyrogram/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyrogram/client.py b/pyrogram/client.py index b7d314ac..71c94264 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -840,6 +840,9 @@ class Client(Methods): if isinstance(e, asyncio.CancelledError): raise e + if isinstance(e, pyrogram.errors.FloodWait): + raise e + return None else: if in_memory: @@ -1062,6 +1065,8 @@ class Client(Methods): await cdn_session.stop() except pyrogram.StopTransmission: raise + except pyrogram.errors.FloodWait: + raise except Exception as e: log.exception(e) finally: