From b64699c4ab9e145ac1ef3b4b9774b48c0c7a9750 Mon Sep 17 00:00:00 2001 From: Feliciano Long Date: Mon, 20 Dec 2021 17:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E5=BD=93=E7=9C=9F=E7=9A=84?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=96=B0=E5=8A=A8=E6=80=81/=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E7=9A=84=E6=97=B6=E5=80=99=E6=89=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=B9=B6=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 当up删除动态的时候,老动态会变成新的,此时不应该重复推送老动态 2. 2021-12-20 b站服务器不稳定,动态列表刷新混乱,造成重复推送 --- plugins/bilibili_sub/data_source.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/bilibili_sub/data_source.py b/plugins/bilibili_sub/data_source.py index df1dd841..039689da 100755 --- a/plugins/bilibili_sub/data_source.py +++ b/plugins/bilibili_sub/data_source.py @@ -254,7 +254,7 @@ async def _get_up_status(id_: int) -> Optional[str]: if dynamic_img: await BilibiliSub.update_sub_info(id_, dynamic_upload_time=dynamic_upload_time) rst += f"{uname} 发布了动态!\n" f"{dynamic_img}\n" - if _user.latest_video_created != latest_video_created and video: + if _user.latest_video_created < latest_video_created and video: rst = rst + "-------------\n" if rst else rst await BilibiliSub.update_sub_info( id_, latest_video_created=latest_video_created @@ -304,7 +304,7 @@ async def get_user_dynamic( browser = await get_browser() if dynamic_info.get("cards") and browser: dynamic_upload_time = dynamic_info["cards"][0]["desc"]["timestamp"] - if local_user.dynamic_upload_time != dynamic_upload_time: + if local_user.dynamic_upload_time < dynamic_upload_time: page = await browser.new_page() await page.goto( f"https://space.bilibili.com/{local_user.uid}/dynamic",