- Deleted obsolete markdown files related to follow tab coordinates testing and results. - Removed outdated batch scripts for launching the Web GUI. - Updated `config.json` to improve reservation handling and adjust prize value settings. - Enhanced logging and error handling in `web_gui.py` and `app.js` for better user experience. - Added automatic screenshot functionality during Web GUI startup for improved monitoring.
57 lines
1.9 KiB
Python
57 lines
1.9 KiB
Python
from __future__ import annotations
|
|
|
|
"""
|
|
Live room helper functions module (WebGUI version).
|
|
|
|
This is a minimal reimplementation of the original live-room helpers,
|
|
with only the interfaces that `douyin_fudai` relies on during normal
|
|
WebGUI runs. The goal is to avoid encoding/syntax issues from the
|
|
external worktree while keeping the main logic running.
|
|
"""
|
|
|
|
from typing import Any
|
|
|
|
|
|
def reflash_zhibo(analyser: Any) -> None:
|
|
"""在关注列表,下拉刷新直播间(当前实现仅打印日志,不做真实滑动)。"""
|
|
try:
|
|
print("下划刷新直播间列表(当前实现未启用实际滑动)")
|
|
# 如果你希望保留真实行为,可以取消下面的注释:
|
|
# analyser.swipe(760, 700, 760, 1500)
|
|
# analyser.operation.delay(5)
|
|
except Exception:
|
|
pass
|
|
|
|
|
|
def check_in_follow_list(analyser: Any) -> bool:
|
|
"""判断是否界面在“我的关注”列表页(当前实现固定返回 False)。"""
|
|
try:
|
|
analyser._log_kv("检测", "check_in_follow_list:当前实现默认不在关注列表")
|
|
except Exception:
|
|
pass
|
|
return False
|
|
|
|
|
|
def check_zhibo_is_closed(analyser: Any) -> bool:
|
|
"""检查当前直播间是否关闭(当前实现固定返回 False)。"""
|
|
try:
|
|
analyser._log_kv("检测", "check_zhibo_is_closed:当前实现默认直播间未关闭")
|
|
except Exception:
|
|
pass
|
|
return False
|
|
|
|
|
|
def get_no_fudai_wait_time(analyser: Any) -> float:
|
|
"""返回距离上次识别到福袋的等待秒数(当前实现固定返回 0)。"""
|
|
try:
|
|
analyser._log_kv("检测", "get_no_fudai_wait_time:当前实现默认0秒")
|
|
except Exception:
|
|
pass
|
|
return 0.0
|
|
|
|
|
|
def check_no_fudai_time(analyser: Any) -> float:
|
|
"""Shim: compatibility wrapper returning the same as get_no_fudai_wait_time."""
|
|
return get_no_fudai_wait_time(analyser)
|
|
|