diff --git a/config/config.json b/config/config.json index 31be595..f095770 100644 --- a/config/config.json +++ b/config/config.json @@ -191,4 +191,4 @@ "enable_streaming_screenshot": false, "fudai_exit_after_misses": 30, "yanghao_only": false -} +} \ No newline at end of file diff --git a/douyin/core/state/reservations.json b/douyin/core/state/reservations.json index fef7263..f14d2f9 100644 --- a/douyin/core/state/reservations.json +++ b/douyin/core/state/reservations.json @@ -1,8 +1,37 @@ { - "updated_ts": 1767491032.6326447, - "reason": "startup_clear", + "updated_ts": 1767491197.3733354, + "reason": "remove_reservation_after_attend", "room_pos": 0, "current_room_title": "", "current_room_title_raw": "", - "reservations": [] -} + "reservations": [ + { + "prize_value_yuan": 6999.0, + "content": "", + "future_ts": 1767491410.899574, + "future_str": "2026-01-04 09:50:10", + "pos_seen": 0, + "room_title": "彩虹夫妇", + "room_title_raw": "彩虹夫妇", + "created_ts": 1767491052.272007, + "task_count": 2, + "time_text": "06:04", + "participants": 0, + "copies": 0 + }, + { + "prize_value_yuan": 5999.0, + "content": "", + "future_ts": 1767491526.677024, + "future_str": "2026-01-04 09:52:06", + "pos_seen": 3, + "room_title": "刘媛媛媛", + "room_title_raw": "刘媛媛.媛", + "created_ts": 1767491172.3842542, + "task_count": 2, + "time_text": "06:00", + "participants": 0, + "copies": 0 + } + ] +} \ No newline at end of file diff --git a/run_cli.py b/run_cli.py index 4566fb2..be4c98f 100644 --- a/run_cli.py +++ b/run_cli.py @@ -417,7 +417,11 @@ def main(argv: list[str]) -> int: device_id, analyser.resolution_ratio_x, analyser.resolution_ratio_y ) ) - seconds = int(args.yanghao_seconds) if getattr(args, "yanghao_seconds", None) else analyser._yanghao_get_recommend_seconds() + seconds = ( + int(args.yanghao_seconds) + if getattr(args, "yanghao_seconds", None) + else analyser._yanghao_get_recommend_seconds() + ) if seconds < 1: seconds = 1 getattr(analyser, "_yanghao_recommend_flow", lambda _: None)(seconds) # type: ignore[attr-defined] diff --git a/tmp_threshold_check.py b/tmp_threshold_check.py new file mode 100644 index 0000000..58745a9 --- /dev/null +++ b/tmp_threshold_check.py @@ -0,0 +1,14 @@ +from douyin.core.douyin_fudai import fudai_analyse +from path_config import get_like_template_path, get_fav_template_path + +a = fudai_analyse() +print("default threshold", a.yanghao_icon_match_threshold) +like_roi = "pic/roi_test_like_20260104000913_1767456556.png" +fav_roi = "pic/roi_test_fav_20260104000916_1767456559.png" +like_tpl = get_like_template_path() +fav_tpl = get_fav_template_path() +print("Like match (default):", a._match_icon_template(like_roi, like_tpl)) +print("Fav match (default):", a._match_icon_template(fav_roi, fav_tpl)) +a.yanghao_icon_match_threshold = 0.5 +print("Like match (thr=0.5):", a._match_icon_template(like_roi, like_tpl)) +print("Fav match (thr=0.5):", a._match_icon_template(fav_roi, fav_tpl))