From f58607d66d859c35515eba94d93ce40c73301e4e Mon Sep 17 00:00:00 2001 From: zlaazlaa <2889827787@qq.com> Date: Mon, 11 Nov 2024 20:30:05 +0800 Subject: [PATCH] Add get message retry Signed-off-by: zlaazlaa <2889827787@qq.com> --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index 44463b7..1fc6a80 100644 --- a/main.py +++ b/main.py @@ -1026,6 +1026,12 @@ def main(page: ft.Page): ) def get_message(start, count): + while True: + message_content = get_message_unsafe(start, count) + if message_content.encoding.lower() == 'utf-8': + return message_content + + def get_message_unsafe(start, count): cookies = page.session.get("user_cookies") g_tk = bkn(cookies['p_skey']) uin = re.sub(r'o0*', '', cookies.get('uin'))