From 6f389071195e37422649fc0820439ba22d91f73b Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 23 May 2026 13:28:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(fudai/reservation):=20=E4=BF=AE=203=20?= =?UTF-8?q?=E5=A4=84=E6=8B=86=E6=A8=A1=E5=9D=97=E9=81=97=E7=95=99=20NameEr?= =?UTF-8?q?ror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - douyin_fudai_core.py: get_fudai_contain 引用 TASK_LIST / PARTICIPATE_BUTTON 但只导入了 LIVE_ROOM_TITLE,运行时必触发 NameError - douyin_reservation_verify.py: match_reservation 末尾日志引用 current_title,但该变量仅在 if expected_title 块内赋值, expected_title 为空时 NameError(被 try/except 吞掉但丢失日志) Co-Authored-By: Claude Sonnet 4.5 --- douyin/fudai/douyin_fudai_core.py | 2 +- douyin/reservation/douyin_reservation_verify.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/douyin/fudai/douyin_fudai_core.py b/douyin/fudai/douyin_fudai_core.py index 80112c3..984ee6b 100644 --- a/douyin/fudai/douyin_fudai_core.py +++ b/douyin/fudai/douyin_fudai_core.py @@ -158,7 +158,7 @@ def get_fudai_contain(analyser, renwu: int = 2) -> Tuple[str, str, int, int, flo return run_heavy_ocr(analyser, fields) # 切割直播间标题图片(用于并行 OCR) - from douyin.fudai.core.coords import LIVE_ROOM_TITLE + from douyin.fudai.core.coords import LIVE_ROOM_TITLE, PARTICIPATE_BUTTON, TASK_LIST analyser.cut_pic(*LIVE_ROOM_TITLE, "", "live_room_title_mid", analyser.y_pianyi) # 切割内容/倒计时/价值(按 renwu 选 countdown_box) diff --git a/douyin/reservation/douyin_reservation_verify.py b/douyin/reservation/douyin_reservation_verify.py index 5bb6fd7..0145423 100644 --- a/douyin/reservation/douyin_reservation_verify.py +++ b/douyin/reservation/douyin_reservation_verify.py @@ -380,6 +380,8 @@ def validate_back_to_reservation( except Exception: pass + current_title = "" + current_title_raw = "" if expected_title: try: # 回退校验时强制重新识别直播间标题,避免复用切换前的旧截图