From 68e3f2ff34da46c7adb9e693f594cb61c751cdcc Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 22 Jan 2026 13:40:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=A8=E4=BD=9C=E5=92=8C=E7=82=B9=E5=87=BB=E7=AD=89?= =?UTF-8?q?=E5=BE=85=E6=97=B6=E9=97=B4=EF=BC=8C=E6=8F=90=E5=8D=87=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=80=BB=E8=BE=91=E6=B8=85=E6=99=B0=E5=BA=A6=EF=BC=9B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=A6=8F=E8=A2=8B=E5=88=86=E6=9E=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BB=A5=E6=94=B9=E5=96=84=E9=A2=84=E7=BA=A6=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.json | 6 +++--- douyin/core/douyin_fudai.py | 43 ++++++++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/config/config.json b/config/config.json index 690fdd8..4fd00d5 100644 --- a/config/config.json +++ b/config/config.json @@ -8,7 +8,7 @@ "skip_if_countdown_gt_seconds": 118, "reset_after_swipes_enabled": true, "reset_after_swipes": 25, - "reset_after_swipes_action": "back", + "reset_after_swipes_action": "swipe", "auto_join_fansclub": true, "fansclub_fail_action": "switch", "high_value_fudai_enabled": true, @@ -29,11 +29,11 @@ "yanghao_fallback_enter_live_x": 540, "yanghao_fallback_enter_live_y": 1200, "fudai_find_max_attempts": 99999, - "fudai_icon_max_wait_seconds": 6.0, + "fudai_icon_max_wait_seconds": 6.5, "fudai_icon_retry_delay_seconds": 0.1, "fudai_exit_after_misses": 10, "enable_back_on_misses": false, - "fudai_click_wait_seconds": 2.0, + "fudai_click_wait_seconds": 1.5, "fudai_detail_initial_wait_seconds": 0.8, "fudai_detail_verified_wait_seconds": 0.2, "fudai_detail_retry_delay_seconds": 0.5, diff --git a/douyin/core/douyin_fudai.py b/douyin/core/douyin_fudai.py index e331599..6413ec2 100644 --- a/douyin/core/douyin_fudai.py +++ b/douyin/core/douyin_fudai.py @@ -1977,25 +1977,44 @@ class fudai_analyse: if just_recorded: self._just_recorded_reservation = False # 清除标志 try: - needswitch = bool(getattr(self, "needswitch", True)) + self._log_kv( + "预约", + "[预约] 刚刚记录预约,继续在新直播间搜索福袋", + ) except Exception: - needswitch = True - if needswitch: + pass + try: + needswitch_cfg = bool(getattr(self, "needswitch", True)) + except Exception: + needswitch_cfg = True + if needswitch_cfg: + try: + self.swipe_up_to_next_live() + except Exception as exc: + try: + self._log_kv( + "预约", + "[预约] 执行上滑切换失败", + error=str(exc), + error_type=type(exc).__name__, + ) + except Exception: + pass + else: try: self._log_kv( "预约", - "[预约] 刚刚记录预约,强制切换直播间避免循环", + "[预约] just_recorded_reservation 触发,但 needswitch=False,未切换", ) except Exception: pass - self.swipe_up_to_next_live() - elapsed = time.time() - start_time - self._log_kv( - "流程", - "run_once_basic完成(强制切换直播间)", - elapsed_seconds=round(elapsed, 2), - ) - return + elapsed = time.time() - start_time + self._log_kv( + "流程", + "run_once_basic完成(记录预约后切换直播间)", + elapsed_seconds=round(elapsed, 2), + ) + return except Exception: pass