fix: 修复微博PC端登录后COOKIE在手机端无法使用的bug

This commit is contained in:
Relakkes
2024-01-06 19:18:07 +08:00
parent fe073801f8
commit 4de14ad6a8
3 changed files with 20 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ import asyncio
import copy
import json
import re
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Callable, Dict, List, Optional
from urllib.parse import urlencode
import httpx
@@ -73,6 +73,8 @@ class WeiboClient:
resp_data: Dict = await self.request(method="GET", url=f"{self._host}{uri}", headers=self.headers)
if resp_data.get("login"):
ping_flag = True
else:
utils.logger.error(f"[WeiboClient.pong] cookie may be invalid and again login...")
except Exception as e:
utils.logger.error(f"[WeiboClient.pong] Pong weibo failed: {e}, and try to login again...")
ping_flag = False