From e64df93eddc0c40c021313bf443d58db4a889085 Mon Sep 17 00:00:00 2001 From: Relakkes Date: Wed, 15 May 2024 23:23:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=B1=E4=BA=8Exhs=E5=92=8Cdy?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E6=A3=80=E6=B5=8Bplaywright=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E7=99=BB=E5=BD=95=E4=BA=86=EF=BC=8C=E5=A4=A7?= =?UTF-8?q?=E6=A6=82=E7=8E=87=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=BB=91=E5=9D=97?= =?UTF-8?q?=E6=88=96=E8=80=85=E6=89=8B=E6=9C=BA=E9=AA=8C=E8=AF=81=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BB=E5=BD=95=E6=80=81=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=B8=BA5min=EF=BC=8C=E9=A2=84=E7=95=99?= =?UTF-8?q?=E8=B6=B3=E5=A4=9F=E7=9A=84=E6=97=B6=E9=97=B4=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=BF=87=E9=AA=8C=E8=AF=81=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media_platform/bilibili/login.py | 2 +- media_platform/douyin/login.py | 2 +- media_platform/kuaishou/login.py | 2 +- media_platform/weibo/login.py | 2 +- media_platform/xhs/login.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/media_platform/bilibili/login.py b/media_platform/bilibili/login.py index ddf11bf..c0f7398 100644 --- a/media_platform/bilibili/login.py +++ b/media_platform/bilibili/login.py @@ -43,7 +43,7 @@ class BilibiliLogin(AbstractLogin): raise ValueError( "[BilibiliLogin.begin] Invalid Login Type Currently only supported qrcode or phone or cookie ...") - @retry(stop=stop_after_attempt(20), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) + @retry(stop=stop_after_attempt(600), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) async def check_login_state(self) -> bool: """ Check if the current login status is successful and return True otherwise return False diff --git a/media_platform/douyin/login.py b/media_platform/douyin/login.py index 69fa84c..e48615e 100644 --- a/media_platform/douyin/login.py +++ b/media_platform/douyin/login.py @@ -68,7 +68,7 @@ class DouYinLogin(AbstractLogin): utils.logger.info(f"[DouYinLogin.begin] Login successful then wait for {wait_redirect_seconds} seconds redirect ...") await asyncio.sleep(wait_redirect_seconds) - @retry(stop=stop_after_attempt(20), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) + @retry(stop=stop_after_attempt(600), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) async def check_login_state(self): """Check if the current login status is successful and return True otherwise return False""" current_cookie = await self.browser_context.cookies() diff --git a/media_platform/kuaishou/login.py b/media_platform/kuaishou/login.py index 001d7b0..7833139 100644 --- a/media_platform/kuaishou/login.py +++ b/media_platform/kuaishou/login.py @@ -39,7 +39,7 @@ class KuaishouLogin(AbstractLogin): else: raise ValueError("[KuaishouLogin.begin] Invalid Login Type Currently only supported qrcode or phone or cookie ...") - @retry(stop=stop_after_attempt(20), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) + @retry(stop=stop_after_attempt(600), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) async def check_login_state(self) -> bool: """ Check if the current login status is successful and return True otherwise return False diff --git a/media_platform/weibo/login.py b/media_platform/weibo/login.py index dd0d737..929aff8 100644 --- a/media_platform/weibo/login.py +++ b/media_platform/weibo/login.py @@ -44,7 +44,7 @@ class WeiboLogin(AbstractLogin): "[WeiboLogin.begin] Invalid Login Type Currently only supported qrcode or phone or cookie ...") - @retry(stop=stop_after_attempt(20), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) + @retry(stop=stop_after_attempt(600), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) async def check_login_state(self, no_logged_in_session: str) -> bool: """ Check if the current login status is successful and return True otherwise return False diff --git a/media_platform/xhs/login.py b/media_platform/xhs/login.py index 7923585..0cff85f 100644 --- a/media_platform/xhs/login.py +++ b/media_platform/xhs/login.py @@ -28,7 +28,7 @@ class XiaoHongShuLogin(AbstractLogin): self.login_phone = login_phone self.cookie_str = cookie_str - @retry(stop=stop_after_attempt(120), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) + @retry(stop=stop_after_attempt(600), wait=wait_fixed(1), retry=retry_if_result(lambda value: value is False)) async def check_login_state(self, no_logged_in_session: str) -> bool: """ Check if the current login status is successful and return True otherwise return False