diff --git a/config/config.json b/config/config.json index fbf9614..9fa2b7c 100644 --- a/config/config.json +++ b/config/config.json @@ -232,5 +232,10 @@ "swipe_down_back_enabled": false, "swipe_down_back_count": 3, "log_unified_enabled": true, - "log_unified_path": "logs/unified.log" + "log_unified_path": "logs/unified.log", + "last_wifi_target": { + "target": "192.168.5.2:5555", + "model": "PEPM00", + "saved_at": 1779501066 + } } diff --git a/douyin/core/douyin_fudai.py b/douyin/core/douyin_fudai.py index 7df4c89..ad00b84 100644 --- a/douyin/core/douyin_fudai.py +++ b/douyin/core/douyin_fudai.py @@ -997,6 +997,7 @@ class fudai_analyse: return # 0.1. 若启用高价值预约:先处理"是否需要回退到预约直播间" + reservation_check_start = time.time() if _ronce_helpers.handle_reservation_check(self, start_time): return diff --git a/douyin/stage/douyin_stage.py b/douyin/stage/douyin_stage.py index 3a69636..da6aa7d 100644 --- a/douyin/stage/douyin_stage.py +++ b/douyin/stage/douyin_stage.py @@ -704,7 +704,7 @@ def diagnose_stage_from_current_screen(analyser, trigger_reason="unknown"): # t # 如果模式0未识别到,尝试模式1 enable_ocr_mode1 = bool( - getattr(analyser, "enable_ocr_mode1", False) + getattr(analyser, "enable_ocr_mode1", True) ) if enable_ocr_mode1 and ( not ocr_text @@ -823,3 +823,4 @@ def diagnose_stage_from_current_screen(analyser, trigger_reason="unknown"): # t 总耗时毫秒=total_elapsed, ) _log_separator("最终结果:IN_LIVE_ROOM(默认直播间)") + return "IN_LIVE_ROOM", "像素检测未命中,默认直播间" diff --git a/douyin/stage/douyin_stage_handler_pkg/ocr_detection.py b/douyin/stage/douyin_stage_handler_pkg/ocr_detection.py index 9413b3c..658763a 100644 --- a/douyin/stage/douyin_stage_handler_pkg/ocr_detection.py +++ b/douyin/stage/douyin_stage_handler_pkg/ocr_detection.py @@ -361,7 +361,7 @@ def _check_redpacket_ocr_when_not_in_live_room( has_high_confidence = ( ocr_confidence_info and ocr_confidence_info.get("max_confidence", 0) - >= analyser.shopping_redpacket_ocr_confidence_threshold + >= getattr(analyser, "shopping_redpacket_ocr_confidence_threshold", 0.35) ) if has_keyword_match or has_high_confidence: @@ -370,7 +370,7 @@ def _check_redpacket_ocr_when_not_in_live_room( "步骤2.5[购物红包OCR复查]-命中", 关键词匹配=has_keyword_match, 高置信度匹配=has_high_confidence, - 阈值=analyser.shopping_redpacket_ocr_confidence_threshold, + 阈值=getattr(analyser, "shopping_redpacket_ocr_confidence_threshold", 0.35), ) except Exception as e: redpacket_elapsed = (time.time() - step_redpacket_ocr_start) * 1000 @@ -524,15 +524,15 @@ def _confirm_live_list( if time.time() - step_start < max_step_time: ocr_start = time.time() - namel0 = preprocess_for_ocr(analyser, "直播列表标签") - t_list = str(analyser.operation.analyse_pic_word(namel0, 0) or "") - ocr_elapsed = (time.time() - ocr_start) * 1000 - log( - "步骤3[OCR直播列表]-OCR模式0", - 耗时毫秒=ocr_elapsed, - 文本长度=len(t_list), - 文本预览=t_list[:50] if t_list else "", - ) + namel0 = preprocess_for_ocr(analyser, "直播列表标签") + t_list = str(analyser.operation.analyse_pic_word(namel0, 0) or "") + ocr_elapsed = (time.time() - ocr_start) * 1000 + log( + "步骤3[OCR直播列表]-OCR模式0", + 耗时毫秒=ocr_elapsed, + 文本长度=len(t_list), + 文本预览=t_list[:50] if t_list else "", + ) if ( enable_ocr_mode1