diff --git a/douyin/core/douyin_fudai.py b/douyin/core/douyin_fudai.py index 03171cf..8569a04 100644 --- a/douyin/core/douyin_fudai.py +++ b/douyin/core/douyin_fudai.py @@ -1207,23 +1207,11 @@ class fudai_analyse: def _handle_in_fudai_detail(self) -> None: """已经在福袋详情页:只跑详情识别 + 是否参与的基础逻辑。""" start_time = time.time() - try: - self._log_kv( - "诊断", - "进入 _handle_in_fudai_detail:记录当前关键 flags", - reservation_after_action_pending=bool( - getattr(self, "reservation_after_action_pending", False) - ), - reservation_focus_until_ts=float( - getattr(self, "reservation_focus_until_ts", 0.0) or 0.0 - ), - waiting_for_lottery=bool( - getattr(self, "_waiting_for_lottery_result", False) - ), - room_pos=int(getattr(self, "room_pos", 0) or 0), - ) - except Exception: - pass + from douyin.core.fudai_modules.fudai_detail_helpers import ( + log_handle_in_fudai_detail_entry, + ) + + log_handle_in_fudai_detail_entry(self) # 注意:点击参与抽奖后会自动关闭详情页,下次循环会跳过阶段检测直接查找福袋 # 检查连续参与失败次数,避免卡死 diff --git a/douyin/core/fudai_modules/fudai_detail_helpers.py b/douyin/core/fudai_modules/fudai_detail_helpers.py index 633bd36..a9fcfa5 100644 --- a/douyin/core/fudai_modules/fudai_detail_helpers.py +++ b/douyin/core/fudai_modules/fudai_detail_helpers.py @@ -42,6 +42,27 @@ def log_screenshot_failed( pass +def log_handle_in_fudai_detail_entry(analyser) -> None: + """_handle_in_fudai_detail 入口诊断日志:记录当前关键 flags。""" + try: + analyser._log_kv( + "诊断", + "进入 _handle_in_fudai_detail:记录当前关键 flags", + reservation_after_action_pending=bool( + getattr(analyser, "reservation_after_action_pending", False) + ), + reservation_focus_until_ts=float( + getattr(analyser, "reservation_focus_until_ts", 0.0) or 0.0 + ), + waiting_for_lottery=bool( + getattr(analyser, "_waiting_for_lottery_result", False) + ), + room_pos=int(getattr(analyser, "room_pos", 0) or 0), + ) + except Exception: + pass + + def take_screenshot_and_diagnose(analyser, start_time: float): """run_once_basic 步骤 1:截图(最多 3 次重试)+ 阶段诊断。