优化后台截图功能

This commit is contained in:
Your Name committed 2025-12-31 11:55:01 +08:00
1 parent 223c127e11
commit ace3bbfa04
70 files changed
+4392 -871

No files matched your search

+2
View File
@@ -92,6 +92,8 @@
+16 -2
View File
@@ -24,7 +24,21 @@ def get_fudai_contain(analyser, renwu: int = 2) -> Tuple[str, str, int, int, flo
"""获取福袋的内容和倒计时(从 `fudai_analyse.get_fudai_contain` 抽离)。"""
# 检查是否启用调试截图保存(默认False,正常运行时跳过以提升性能)
save_debug_images = bool(getattr(analyser, "fudai_detail_save_debug_images", False) or False)
try:
save_debug_images = bool(getattr(analyser, "fudai_detail_save_debug_images", False))
except Exception:
save_debug_images = False
# 如果analyser未提供配置,回退到全局配置文件
if not save_debug_images:
try:
import json
cfg_path = path_config.get_config_path()
if os.path.exists(cfg_path):
with open(cfg_path, "r", encoding="utf-8") as f:
cfg = json.load(f)
save_debug_images = bool(cfg.get("fudai_detail_save_debug_images", False))
except Exception:
pass
def _parse_mm_ss(text: str):
m = re.search(r"(\d{1,2})[::](\d{2})", str(text or ""))
@@ -2877,7 +2891,7 @@ def attend_choujiang(analyser) -> bool:
# 尝试重新打开福袋详情页
try:
# 延迟导入避免循环导入
from douyin.core import douyin_flow_control
import douyin.core.douyin_flow_control as douyin_flow_control
room_pos_ref = [0]
opened = douyin_flow_control.find_and_open_fudai_detail(
+1 -1
View File
@@ -118,7 +118,7 @@ else:
# 2. 查找福袋图标并尝试打开
analyser._log_kv("流程", "查找福袋图标")
try:
from douyin.core import douyin_flow_control
import douyin.core.douyin_flow_control as douyin_flow_control
room_pos_ref = [int(getattr(analyser, "room_pos", 0) or 0)]
opened = douyin_flow_control.find_and_open_fudai_detail(analyser, room_pos_ref)
if opened:
+2
View File
@@ -56,6 +56,8 @@ __all__ = [