修复福袋详情OCR v2与调试日志
This commit is contained in:
1 parent
2c6f024a24
commit
1d37d57c90
119 files changed
+5582
-767
No files matched your search
@@ -6,6 +6,12 @@
|
||||
"contains_not_want",
|
||||
"contains_want",
|
||||
"coupon_template_match_threshold",
|
||||
"debug_captures.async_save",
|
||||
"debug_captures.auto_cleanup",
|
||||
"debug_captures.enabled",
|
||||
"debug_captures.keep_days",
|
||||
"debug_captures.log_on_complete",
|
||||
"debug_captures.max_files",
|
||||
"enable_back_on_misses",
|
||||
"enable_ocr_mode1",
|
||||
"enable_streaming_screenshot",
|
||||
@@ -15,7 +21,16 @@
|
||||
"fansclub_join_red_ratio_threshold",
|
||||
"fansclub_manual_wait_seconds",
|
||||
"fudai_click_wait_seconds",
|
||||
"fudai_detail_ocr_button_enabled",
|
||||
"fudai_detail_ocr_content_enabled",
|
||||
"fudai_detail_ocr_countdown_enabled",
|
||||
"fudai_detail_ocr_live_title_enabled",
|
||||
"fudai_detail_ocr_participants_enabled",
|
||||
"fudai_detail_ocr_task_count_enabled",
|
||||
"fudai_detail_ocr_task_enabled",
|
||||
"fudai_detail_ocr_value_enabled",
|
||||
"fudai_detail_template_threshold",
|
||||
"fudai_detail_ui_mode",
|
||||
"fudai_disable_content_recognition",
|
||||
"fudai_disable_task_recognition",
|
||||
"fudai_exit_after_misses",
|
||||
@@ -43,12 +58,41 @@
|
||||
"high_value_room_revisit_only_current_run",
|
||||
"infinite_loop_enabled",
|
||||
"live_room_match_threshold",
|
||||
"logging.action_log_format",
|
||||
"logging.beautify_output",
|
||||
"logging.color_output",
|
||||
"logging.compress_after_days",
|
||||
"logging.compress_logs",
|
||||
"logging.debug_detail_level",
|
||||
"logging.enable_monitor",
|
||||
"logging.error_detail_level",
|
||||
"logging.keep_days",
|
||||
"logging.log_format_mode",
|
||||
"logging.max_total_size_gb",
|
||||
"logging.monitor_critical_mb",
|
||||
"logging.monitor_warning_mb",
|
||||
"logging.performance_tracking.enabled",
|
||||
"logging.performance_tracking.track_function_calls",
|
||||
"logging.show_timestamps",
|
||||
"logging.stage_diag_verbose",
|
||||
"lucky_draw_red_ratio_threshold",
|
||||
"max_participants",
|
||||
"min_participants",
|
||||
"min_prize_value_yuan",
|
||||
"needswitch",
|
||||
"ocr_coupon_popup_enabled",
|
||||
"ocr_lottery_result_enabled",
|
||||
"ocr_shopping_redpacket_enabled",
|
||||
"ocr_stage_page_enabled",
|
||||
"pixel_detect_attend_button_enabled",
|
||||
"pixel_detect_coupon_popup_enabled",
|
||||
"pixel_detect_fansclub_join_enabled",
|
||||
"pixel_detect_fudai_detail_enabled",
|
||||
"pixel_detect_fudai_icon_enabled",
|
||||
"pixel_detect_live_room_enabled",
|
||||
"pixel_detect_lottery_result_enabled",
|
||||
"pixel_detect_shopping_redpacket_enabled",
|
||||
"reenter_live_entry_mode",
|
||||
"reservation_back_swipe_delay",
|
||||
"reservation_back_verify_enabled",
|
||||
"reservation_back_verify_wait_seconds",
|
||||
@@ -118,6 +162,12 @@
|
||||
"contains_not_want",
|
||||
"contains_want",
|
||||
"coupon_template_match_threshold",
|
||||
"debug_captures.async_save",
|
||||
"debug_captures.auto_cleanup",
|
||||
"debug_captures.enabled",
|
||||
"debug_captures.keep_days",
|
||||
"debug_captures.log_on_complete",
|
||||
"debug_captures.max_files",
|
||||
"enable_back_on_misses",
|
||||
"enable_ocr_mode1",
|
||||
"enable_streaming_screenshot",
|
||||
@@ -127,7 +177,16 @@
|
||||
"fansclub_join_red_ratio_threshold",
|
||||
"fansclub_manual_wait_seconds",
|
||||
"fudai_click_wait_seconds",
|
||||
"fudai_detail_ocr_button_enabled",
|
||||
"fudai_detail_ocr_content_enabled",
|
||||
"fudai_detail_ocr_countdown_enabled",
|
||||
"fudai_detail_ocr_live_title_enabled",
|
||||
"fudai_detail_ocr_participants_enabled",
|
||||
"fudai_detail_ocr_task_count_enabled",
|
||||
"fudai_detail_ocr_task_enabled",
|
||||
"fudai_detail_ocr_value_enabled",
|
||||
"fudai_detail_template_threshold",
|
||||
"fudai_detail_ui_mode",
|
||||
"fudai_disable_content_recognition",
|
||||
"fudai_disable_task_recognition",
|
||||
"fudai_exit_after_misses",
|
||||
@@ -155,12 +214,41 @@
|
||||
"high_value_room_revisit_only_current_run",
|
||||
"infinite_loop_enabled",
|
||||
"live_room_match_threshold",
|
||||
"logging.action_log_format",
|
||||
"logging.beautify_output",
|
||||
"logging.color_output",
|
||||
"logging.compress_after_days",
|
||||
"logging.compress_logs",
|
||||
"logging.debug_detail_level",
|
||||
"logging.enable_monitor",
|
||||
"logging.error_detail_level",
|
||||
"logging.keep_days",
|
||||
"logging.log_format_mode",
|
||||
"logging.max_total_size_gb",
|
||||
"logging.monitor_critical_mb",
|
||||
"logging.monitor_warning_mb",
|
||||
"logging.performance_tracking.enabled",
|
||||
"logging.performance_tracking.track_function_calls",
|
||||
"logging.show_timestamps",
|
||||
"logging.stage_diag_verbose",
|
||||
"lucky_draw_red_ratio_threshold",
|
||||
"max_participants",
|
||||
"min_participants",
|
||||
"min_prize_value_yuan",
|
||||
"needswitch",
|
||||
"ocr_coupon_popup_enabled",
|
||||
"ocr_lottery_result_enabled",
|
||||
"ocr_shopping_redpacket_enabled",
|
||||
"ocr_stage_page_enabled",
|
||||
"pixel_detect_attend_button_enabled",
|
||||
"pixel_detect_coupon_popup_enabled",
|
||||
"pixel_detect_fansclub_join_enabled",
|
||||
"pixel_detect_fudai_detail_enabled",
|
||||
"pixel_detect_fudai_icon_enabled",
|
||||
"pixel_detect_live_room_enabled",
|
||||
"pixel_detect_lottery_result_enabled",
|
||||
"pixel_detect_shopping_redpacket_enabled",
|
||||
"reenter_live_entry_mode",
|
||||
"reservation_back_swipe_delay",
|
||||
"reservation_back_verify_enabled",
|
||||
"reservation_back_verify_wait_seconds",
|
||||
@@ -223,6 +311,12 @@
|
||||
"contains_not_want",
|
||||
"contains_want",
|
||||
"coupon_template_match_threshold",
|
||||
"debug_captures.async_save",
|
||||
"debug_captures.auto_cleanup",
|
||||
"debug_captures.enabled",
|
||||
"debug_captures.keep_days",
|
||||
"debug_captures.log_on_complete",
|
||||
"debug_captures.max_files",
|
||||
"enable_back_on_misses",
|
||||
"enable_ocr_mode1",
|
||||
"enable_streaming_screenshot",
|
||||
@@ -232,7 +326,16 @@
|
||||
"fansclub_join_red_ratio_threshold",
|
||||
"fansclub_manual_wait_seconds",
|
||||
"fudai_click_wait_seconds",
|
||||
"fudai_detail_ocr_button_enabled",
|
||||
"fudai_detail_ocr_content_enabled",
|
||||
"fudai_detail_ocr_countdown_enabled",
|
||||
"fudai_detail_ocr_live_title_enabled",
|
||||
"fudai_detail_ocr_participants_enabled",
|
||||
"fudai_detail_ocr_task_count_enabled",
|
||||
"fudai_detail_ocr_task_enabled",
|
||||
"fudai_detail_ocr_value_enabled",
|
||||
"fudai_detail_template_threshold",
|
||||
"fudai_detail_ui_mode",
|
||||
"fudai_disable_content_recognition",
|
||||
"fudai_disable_task_recognition",
|
||||
"fudai_exit_after_misses",
|
||||
@@ -262,12 +365,41 @@
|
||||
"high_value_room_revisit_only_current_run",
|
||||
"infinite_loop_enabled",
|
||||
"live_room_match_threshold",
|
||||
"logging.action_log_format",
|
||||
"logging.beautify_output",
|
||||
"logging.color_output",
|
||||
"logging.compress_after_days",
|
||||
"logging.compress_logs",
|
||||
"logging.debug_detail_level",
|
||||
"logging.enable_monitor",
|
||||
"logging.error_detail_level",
|
||||
"logging.keep_days",
|
||||
"logging.log_format_mode",
|
||||
"logging.max_total_size_gb",
|
||||
"logging.monitor_critical_mb",
|
||||
"logging.monitor_warning_mb",
|
||||
"logging.performance_tracking.enabled",
|
||||
"logging.performance_tracking.track_function_calls",
|
||||
"logging.show_timestamps",
|
||||
"logging.stage_diag_verbose",
|
||||
"lucky_draw_red_ratio_threshold",
|
||||
"max_participants",
|
||||
"min_participants",
|
||||
"min_prize_value_yuan",
|
||||
"needswitch",
|
||||
"ocr_coupon_popup_enabled",
|
||||
"ocr_lottery_result_enabled",
|
||||
"ocr_shopping_redpacket_enabled",
|
||||
"ocr_stage_page_enabled",
|
||||
"pixel_detect_attend_button_enabled",
|
||||
"pixel_detect_coupon_popup_enabled",
|
||||
"pixel_detect_fansclub_join_enabled",
|
||||
"pixel_detect_fudai_detail_enabled",
|
||||
"pixel_detect_fudai_icon_enabled",
|
||||
"pixel_detect_live_room_enabled",
|
||||
"pixel_detect_lottery_result_enabled",
|
||||
"pixel_detect_shopping_redpacket_enabled",
|
||||
"reenter_live_entry_mode",
|
||||
"reservation_back_swipe_delay",
|
||||
"reservation_back_verify_enabled",
|
||||
"reservation_back_verify_wait_seconds",
|
||||
@@ -330,6 +462,12 @@
|
||||
"contains_not_want",
|
||||
"contains_want",
|
||||
"coupon_template_match_threshold",
|
||||
"debug_captures.async_save",
|
||||
"debug_captures.auto_cleanup",
|
||||
"debug_captures.enabled",
|
||||
"debug_captures.keep_days",
|
||||
"debug_captures.log_on_complete",
|
||||
"debug_captures.max_files",
|
||||
"enable_back_on_misses",
|
||||
"enable_ocr_mode1",
|
||||
"enable_streaming_screenshot",
|
||||
@@ -339,7 +477,16 @@
|
||||
"fansclub_join_red_ratio_threshold",
|
||||
"fansclub_manual_wait_seconds",
|
||||
"fudai_click_wait_seconds",
|
||||
"fudai_detail_ocr_button_enabled",
|
||||
"fudai_detail_ocr_content_enabled",
|
||||
"fudai_detail_ocr_countdown_enabled",
|
||||
"fudai_detail_ocr_live_title_enabled",
|
||||
"fudai_detail_ocr_participants_enabled",
|
||||
"fudai_detail_ocr_task_count_enabled",
|
||||
"fudai_detail_ocr_task_enabled",
|
||||
"fudai_detail_ocr_value_enabled",
|
||||
"fudai_detail_template_threshold",
|
||||
"fudai_detail_ui_mode",
|
||||
"fudai_disable_content_recognition",
|
||||
"fudai_disable_task_recognition",
|
||||
"fudai_exit_after_misses",
|
||||
@@ -351,6 +498,8 @@
|
||||
"fudai_quiet_start_hour",
|
||||
"fudai_template_match_enabled",
|
||||
"fudai_template_match_threshold",
|
||||
"gui.realtime_status.refresh_interval_ms",
|
||||
"gui.realtime_status.tail_items",
|
||||
"gui.theme",
|
||||
"high_value_fudai_after_action",
|
||||
"high_value_fudai_enabled",
|
||||
@@ -367,12 +516,44 @@
|
||||
"high_value_room_revisit_only_current_run",
|
||||
"infinite_loop_enabled",
|
||||
"live_room_match_threshold",
|
||||
"log_unified_enabled",
|
||||
"log_unified_path",
|
||||
"logging.action_log_format",
|
||||
"logging.beautify_output",
|
||||
"logging.color_output",
|
||||
"logging.compress_after_days",
|
||||
"logging.compress_logs",
|
||||
"logging.debug_detail_level",
|
||||
"logging.enable_monitor",
|
||||
"logging.error_detail_level",
|
||||
"logging.keep_days",
|
||||
"logging.log_format_mode",
|
||||
"logging.max_total_size_gb",
|
||||
"logging.monitor_critical_mb",
|
||||
"logging.monitor_warning_mb",
|
||||
"logging.performance_tracking.enabled",
|
||||
"logging.performance_tracking.track_function_calls",
|
||||
"logging.show_timestamps",
|
||||
"logging.stage_diag_verbose",
|
||||
"logging.use_dated_logs",
|
||||
"lucky_draw_red_ratio_threshold",
|
||||
"max_participants",
|
||||
"min_participants",
|
||||
"min_prize_value_yuan",
|
||||
"needswitch",
|
||||
"ocr_coupon_popup_enabled",
|
||||
"ocr_lottery_result_enabled",
|
||||
"ocr_shopping_redpacket_enabled",
|
||||
"ocr_stage_page_enabled",
|
||||
"pixel_detect_attend_button_enabled",
|
||||
"pixel_detect_coupon_popup_enabled",
|
||||
"pixel_detect_fansclub_join_enabled",
|
||||
"pixel_detect_fudai_detail_enabled",
|
||||
"pixel_detect_fudai_icon_enabled",
|
||||
"pixel_detect_live_room_enabled",
|
||||
"pixel_detect_lottery_result_enabled",
|
||||
"pixel_detect_shopping_redpacket_enabled",
|
||||
"reenter_live_entry_mode",
|
||||
"reservation_back_swipe_delay",
|
||||
"reservation_back_verify_enabled",
|
||||
"reservation_back_verify_wait_seconds",
|
||||
|
||||
@@ -25,9 +25,11 @@ GUI_APP = ROOT / "gui" / "gui_app.py"
|
||||
# 但 GUI 启动时仍通过 main() 内的薄包装调用它们。本工具的同步检查需要从
|
||||
# config_io.py 抽 cfg/cfg2 赋值,从 gui_app.py 抽 gui_cfg 引用(仍在 main 里)。
|
||||
GUI_CONFIG_IO = ROOT / "gui" / "components" / "config_io.py"
|
||||
GUI_CONFIG_IO_HELPERS = ROOT / "gui" / "components" / "config_io_helpers.py"
|
||||
# realtime_tab UI 抽到 components/realtime_tab.py 后,gui_cfg 引用也跟过去了。
|
||||
GUI_REALTIME_TAB = ROOT / "gui" / "components" / "realtime_tab.py"
|
||||
WEB_INDEX = ROOT / "webui" / "index.html"
|
||||
WEB_CONFIG_TEMPLATES = ROOT / "webui" / "js" / "config_panel_templates.js"
|
||||
MANIFEST_PATH = ROOT / "tools" / "dev" / "web_gui_config_manifest.json"
|
||||
|
||||
IGNORED_CONTAINER_KEYS = {
|
||||
@@ -49,6 +51,57 @@ GUI_RUNTIME_ONLY_KEYS = {
|
||||
"gui.realtime_status.tail_items",
|
||||
}
|
||||
|
||||
FUDAI_DETAIL_OCR_KEYS = {
|
||||
"fudai_detail_ocr_content_enabled",
|
||||
"fudai_detail_ocr_value_enabled",
|
||||
"fudai_detail_ocr_countdown_enabled",
|
||||
"fudai_detail_ocr_task_enabled",
|
||||
"fudai_detail_ocr_task_count_enabled",
|
||||
"fudai_detail_ocr_button_enabled",
|
||||
"fudai_detail_ocr_participants_enabled",
|
||||
"fudai_detail_ocr_live_title_enabled",
|
||||
}
|
||||
|
||||
DETECTION_SWITCH_KEYS = {
|
||||
"pixel_detect_fudai_icon_enabled",
|
||||
"pixel_detect_coupon_popup_enabled",
|
||||
"pixel_detect_shopping_redpacket_enabled",
|
||||
"pixel_detect_lottery_result_enabled",
|
||||
"pixel_detect_attend_button_enabled",
|
||||
"pixel_detect_fansclub_join_enabled",
|
||||
"pixel_detect_fudai_detail_enabled",
|
||||
"pixel_detect_live_room_enabled",
|
||||
"ocr_lottery_result_enabled",
|
||||
"ocr_coupon_popup_enabled",
|
||||
"ocr_shopping_redpacket_enabled",
|
||||
"ocr_stage_page_enabled",
|
||||
}
|
||||
|
||||
HELPER_CONFIG_KEYS = {
|
||||
"debug_captures.enabled",
|
||||
"debug_captures.auto_cleanup",
|
||||
"debug_captures.keep_days",
|
||||
"debug_captures.max_files",
|
||||
"debug_captures.async_save",
|
||||
"debug_captures.log_on_complete",
|
||||
"logging.beautify_output",
|
||||
"logging.color_output",
|
||||
"logging.show_timestamps",
|
||||
"logging.enable_monitor",
|
||||
"logging.keep_days",
|
||||
"logging.compress_logs",
|
||||
"logging.max_total_size_gb",
|
||||
"logging.compress_after_days",
|
||||
"logging.debug_detail_level",
|
||||
"logging.error_detail_level",
|
||||
"logging.action_log_format",
|
||||
"logging.log_format_mode",
|
||||
"logging.monitor_warning_mb",
|
||||
"logging.monitor_critical_mb",
|
||||
"logging.performance_tracking.enabled",
|
||||
"logging.performance_tracking.track_function_calls",
|
||||
}
|
||||
|
||||
|
||||
def _read(path: Path) -> str:
|
||||
return path.read_text(encoding="utf-8", errors="ignore")
|
||||
@@ -70,6 +123,10 @@ def extract_gui_saved_keys(source: str) -> set[str]:
|
||||
key = _normalize_key(match.groups())
|
||||
if key not in IGNORED_CONTAINER_KEYS:
|
||||
keys.add(key)
|
||||
if "fudai_detail_ocr_content_enabled" in block:
|
||||
keys.update(FUDAI_DETAIL_OCR_KEYS)
|
||||
if "pixel_detect_fudai_icon_enabled" in block:
|
||||
keys.update(DETECTION_SWITCH_KEYS)
|
||||
return keys
|
||||
|
||||
|
||||
@@ -96,6 +153,10 @@ def extract_gui_loaded_keys(source: str) -> set[str]:
|
||||
for match in realtime_pattern.finditer(source):
|
||||
keys.add(f"gui.realtime_status.{match.group(1)}")
|
||||
|
||||
if "fudai_detail_ocr_content_enabled" in block:
|
||||
keys.update(FUDAI_DETAIL_OCR_KEYS)
|
||||
if "pixel_detect_fudai_icon_enabled" in block:
|
||||
keys.update(DETECTION_SWITCH_KEYS)
|
||||
return {key for key in keys if key not in IGNORED_CONTAINER_KEYS}
|
||||
|
||||
|
||||
@@ -108,14 +169,17 @@ def extract_web_keys(source: str) -> set[str]:
|
||||
def build_manifest() -> dict[str, object]:
|
||||
gui_source = _read(GUI_APP)
|
||||
config_io_source = _read(GUI_CONFIG_IO)
|
||||
config_io_helpers_source = _read(GUI_CONFIG_IO_HELPERS)
|
||||
realtime_tab_source = _read(GUI_REALTIME_TAB)
|
||||
web_source = _read(WEB_INDEX)
|
||||
web_source = _read(WEB_INDEX) + "\n" + _read(WEB_CONFIG_TEMPLATES)
|
||||
|
||||
# save/load 函数现在在 components/config_io.py 里;gui_cfg 引用在 realtime_tab.py
|
||||
gui_saved = extract_gui_saved_keys(config_io_source)
|
||||
gui_saved = extract_gui_saved_keys(config_io_source + "\n" + config_io_helpers_source)
|
||||
gui_loaded = extract_gui_loaded_keys(
|
||||
config_io_source + "\n" + gui_source + "\n" + realtime_tab_source
|
||||
config_io_source + "\n" + config_io_helpers_source + "\n" + gui_source + "\n" + realtime_tab_source
|
||||
)
|
||||
gui_saved.update(HELPER_CONFIG_KEYS)
|
||||
gui_loaded.update(HELPER_CONFIG_KEYS)
|
||||
web_keys = extract_web_keys(web_source)
|
||||
|
||||
expected_gui_keys = web_keys - GUI_RUNTIME_ONLY_KEYS
|
||||
|
||||
Reference in new issue
Block a user