Add get message retry

Signed-off-by: zlaazlaa <2889827787@qq.com>
This commit is contained in:
zlaazlaa 2024-11-11 20:30:05 +08:00
parent 57a4776135
commit f58607d66d

View File

@ -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'))