From 4f0e8c364d7779e631ab3f184dab4f996f631449 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 4 Jan 2026 09:47:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=98=88=E5=80=BC?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E8=84=9A=E6=9C=AC=EF=BC=8C=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=98=88=E5=80=BC=E5=8F=8A=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=20refactor:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=EF=BC=8C=E8=B0=83=E6=95=B4=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E8=A1=A8=E8=BE=BE=E5=BC=8F=E4=B8=BA=E5=A4=9A=E8=A1=8C?= =?UTF-8?q?=20fix:=20=E6=9B=B4=E6=96=B0=E9=A2=84=E5=AE=9A=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=B7=B2=E5=8F=82=E5=8A=A0?= =?UTF-8?q?=E7=9A=84=E9=A2=84=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.json | 2 +- douyin/core/state/reservations.json | 37 +++++++++++++++++++++++++---- run_cli.py | 6 ++++- tmp_threshold_check.py | 14 +++++++++++ 4 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 tmp_threshold_check.py 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))