refactor: 清理代码,移除多余空行以提升可读性
This commit is contained in:
1 parent
d81eea63c9
commit
804a9224ca
7 files changed
+20
-123
No files matched your search
@@ -2495,7 +2495,7 @@ class underlying_operations:
|
||||
|
||||
注意:uiautomator 在某些设备上可能也需要权限,但可以尝试作为备选方案。
|
||||
"""
|
||||
|
||||
|
||||
# 使用 uiautomator swipe 命令
|
||||
# 注意:uiautomator 命令格式可能因 Android 版本而异
|
||||
# Android 5.0+: uiautomator swipe <x1> <y1> <x2> <y2> [steps]
|
||||
@@ -2523,7 +2523,6 @@ class underlying_operations:
|
||||
优点:绕过部分权限检查
|
||||
缺点:需要 root 权限,实现复杂,不同设备的事件格式可能不同
|
||||
"""
|
||||
|
||||
|
||||
# 获取触摸设备路径(通常是 /dev/input/eventX)
|
||||
result = subprocess.run(
|
||||
|
||||
@@ -1,121 +1,8 @@
|
||||
{
|
||||
"updated_ts": 1767490647.4599805,
|
||||
"reason": "record_reservation",
|
||||
"room_pos": 3,
|
||||
"current_room_title": "带娃的小",
|
||||
"current_room_title_raw": "带娃的小.",
|
||||
"reservations": [
|
||||
{
|
||||
"prize_value_yuan": 3499.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491224.559842,
|
||||
"future_str": "2026-01-04 09:47:04",
|
||||
"pos_seen": 3,
|
||||
"room_title": "带娃的小",
|
||||
"room_title_raw": "带娃的小.",
|
||||
"created_ts": 1767490541.6079862,
|
||||
"task_count": 2,
|
||||
"time_text": "11:28",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491289.735911,
|
||||
"future_str": "2026-01-04 09:48:09",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作川帮粼",
|
||||
"room_title_raw": "作川帮粼。。",
|
||||
"created_ts": 1767490498.9667225,
|
||||
"task_count": 2,
|
||||
"time_text": "13:16",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491289.793185,
|
||||
"future_str": "2026-01-04 09:48:09",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作小帮粼",
|
||||
"room_title_raw": "作小帮粼。。",
|
||||
"created_ts": 1767490410.0147398,
|
||||
"task_count": 2,
|
||||
"time_text": "14:45",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491290.024826,
|
||||
"future_str": "2026-01-04 09:48:10",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作I帮粼",
|
||||
"room_title_raw": "作I帮粼。。",
|
||||
"created_ts": 1767490513.3146324,
|
||||
"task_count": 2,
|
||||
"time_text": "13:02",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491290.032546,
|
||||
"future_str": "2026-01-04 09:48:10",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作小帮数",
|
||||
"room_title_raw": "作小帮数。。",
|
||||
"created_ts": 1767490484.413875,
|
||||
"task_count": 2,
|
||||
"time_text": "13:31",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491290.039379,
|
||||
"future_str": "2026-01-04 09:48:10",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作小帮",
|
||||
"room_title_raw": "作小帮\"。。",
|
||||
"created_ts": 1767490439.3004336,
|
||||
"task_count": 2,
|
||||
"time_text": "14:16",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491290.433496,
|
||||
"future_str": "2026-01-04 09:48:10",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作小羿敉",
|
||||
"room_title_raw": "作小羿敉。。",
|
||||
"created_ts": 1767490424.8472722,
|
||||
"task_count": 2,
|
||||
"time_text": "14:31",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
},
|
||||
{
|
||||
"prize_value_yuan": 1999.0,
|
||||
"content": "",
|
||||
"future_ts": 1767491291.276375,
|
||||
"future_str": "2026-01-04 09:48:11",
|
||||
"pos_seen": 0,
|
||||
"room_title": "作川帮数",
|
||||
"room_title_raw": "作川帮数。。",
|
||||
"created_ts": 1767490469.6016176,
|
||||
"task_count": 2,
|
||||
"time_text": "13:47",
|
||||
"participants": 0,
|
||||
"copies": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
"updated_ts": 1767491032.6326447,
|
||||
"reason": "startup_clear",
|
||||
"room_pos": 0,
|
||||
"current_room_title": "",
|
||||
"current_room_title_raw": "",
|
||||
"reservations": []
|
||||
}
|
||||
@@ -11,6 +11,7 @@ from typing import Any
|
||||
try:
|
||||
from douyin.utils.ocr_preprocess import preprocess_for_ocr # type: ignore
|
||||
except Exception: # pyright: ignore
|
||||
|
||||
def preprocess_for_ocr(_analyser, picname: str) -> str: # type: ignore
|
||||
try:
|
||||
return str(picname)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
- 滑动次数重置
|
||||
- 返回推荐页并重新进入
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
- 根据标题查找位置
|
||||
- 记录直播间标题和位置
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
|
||||
@@ -327,7 +327,14 @@ def add_reservation_core_logic(
|
||||
is_similar_room_title
|
||||
and is_similar_time
|
||||
and is_same_prize_value
|
||||
and is_similar_content
|
||||
and (
|
||||
is_similar_content
|
||||
or (
|
||||
# 如果内容核心均为空(OCR 未识别到内容),则允许仅凭直播间名称相似、时间接近和价值相同判定为重复
|
||||
not content_core
|
||||
and not r_content_core
|
||||
)
|
||||
)
|
||||
):
|
||||
# 通过相似度匹配判断为同一个预约(处理OCR误差)
|
||||
same_idx = idx
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
处理直播间标题的OCR识别、噪音过滤、规范化等功能。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Tuple, List
|
||||
|
||||
Reference in new issue
Block a user