Compare commits
7
Commits
4f147d214e
...
0d01dabb69
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d01dabb69 | ||
|
|
7001919642 | ||
|
|
95255a4498 | ||
|
|
540ee24861 | ||
|
|
b161a2c4a6 | ||
|
|
ac55428640 | ||
|
|
6fb7707abb |
No files matched your search
@@ -171,11 +171,7 @@ def check_detail_height(analyser: Any) -> int:
|
||||
|
||||
# 保存调试图片:标注检测区域和检测点
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
# 计算检测区域(参与按钮附近的区域)
|
||||
check_region_x1 = max(0, x - 50)
|
||||
@@ -533,11 +529,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
|
||||
# 双截图记录:保存实时操作截图(像素检测区域)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
douyin_screenshot_manager.save_latest_attempt(
|
||||
roi, operation_type="pixel_detect"
|
||||
@@ -604,11 +596,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
|
||||
# 双截图记录:保存成功识别存档截图
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
douyin_screenshot_manager.save_last_success(
|
||||
roi, operation_type="pixel_detect"
|
||||
@@ -774,11 +762,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
|
||||
# 双截图记录:保存成功识别存档截图
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
detect_roi = pic_new.crop(
|
||||
(
|
||||
@@ -956,11 +940,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
|
||||
# 双截图记录:保存实时操作截图(搜索区域)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
from PIL import Image as PILImage
|
||||
|
||||
search_roi_pil = PILImage.fromarray(
|
||||
@@ -994,11 +974,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
if max_val >= template_threshold:
|
||||
# 双截图记录:保存成功识别存档截图
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
from PIL import Image as PILImage
|
||||
|
||||
search_roi_pil = PILImage.fromarray(
|
||||
@@ -1429,11 +1405,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
|
||||
# 双截图记录:保存实时操作截图(搜索区域)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
from PIL import Image as PILImage
|
||||
|
||||
search_roi_pil = PILImage.fromarray(
|
||||
@@ -1493,11 +1465,7 @@ def check_have_fudai_with_ready_screenshot(
|
||||
if max_val >= template_threshold:
|
||||
# 双截图记录:保存成功识别存档截图
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
from PIL import Image as PILImage
|
||||
|
||||
search_roi_pil = PILImage.fromarray(
|
||||
|
||||
@@ -325,11 +325,7 @@ def detect_lucky_draw_result_popup(
|
||||
# 双截图记录:保存实时操作截图(像素检测区域)
|
||||
detect_roi = None
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
detect_roi = pic_rgb.crop((x1, y1, x2, y2))
|
||||
douyin_screenshot_manager.save_latest_attempt(
|
||||
@@ -387,11 +383,7 @@ def detect_lucky_draw_result_popup(
|
||||
|
||||
# 保存调试图像(检测结果)- 使用全屏截图,用框框选出识别区域
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
if result:
|
||||
# 检测成功
|
||||
@@ -486,11 +478,7 @@ def detect_attend_button_red_area(
|
||||
|
||||
# 保存调试图像(检测前)- 使用全屏截图,用框框选出识别区域
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
debug_path = douyin_screenshot_manager.save_debug_image(
|
||||
pic_rgb, # 使用全屏截图
|
||||
@@ -564,11 +552,7 @@ def detect_attend_button_red_area(
|
||||
# 保存调试图像(检测结果)- 使用全屏截图,用框框选出识别区域
|
||||
# 无论成功失败都保存debug截图
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
debug_path = douyin_screenshot_manager.save_debug_image(
|
||||
pic_rgb, # 使用全屏截图
|
||||
@@ -651,11 +635,7 @@ def detect_fansclub_join_red_area(
|
||||
|
||||
# 保存调试图像(检测前)- 使用全屏截图,用框框选出识别区域
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
debug_path = douyin_screenshot_manager.save_debug_image(
|
||||
pic_rgb, # 使用全屏截图
|
||||
@@ -723,11 +703,7 @@ def detect_fansclub_join_red_area(
|
||||
|
||||
# 保存调试图像(检测结果)- 使用全屏截图,用框框选出识别区域
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
# 无论成功失败都保存debug截图
|
||||
debug_path = douyin_screenshot_manager.save_debug_image(
|
||||
@@ -880,11 +856,7 @@ def detect_live_room_icons_by_pixel(pic_rgb: Image.Image) -> tuple[bool, float]:
|
||||
|
||||
# 保存调试图像(检测结果)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
debug_path = douyin_screenshot_manager.save_debug_image(
|
||||
pic_rgb, # 使用全屏截图
|
||||
|
||||
@@ -525,11 +525,7 @@ def attend_choujiang(analyser) -> bool:
|
||||
|
||||
# 保存debug截图:标注OCR识别区域(参与按钮区域)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
pic_path = path_config.get_screenshot_path()
|
||||
if os.path.exists(pic_path):
|
||||
@@ -684,11 +680,7 @@ def attend_choujiang(analyser) -> bool:
|
||||
|
||||
# 保存debug截图:标注OCR识别区域(加入粉丝团按钮区域)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
pic_path = path_config.get_screenshot_path()
|
||||
if os.path.exists(pic_path):
|
||||
|
||||
@@ -762,11 +762,7 @@ class FudaiDetector:
|
||||
|
||||
# 保存模板匹配的调试图像(无论成功与否)- 使用完整截图
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
# Image 已在文件顶部导入
|
||||
|
||||
# 使用完整截图而不是搜索区域ROI
|
||||
@@ -1270,11 +1266,7 @@ class FudaiDetailVerifier:
|
||||
|
||||
# 保存完整截图并标注OCR区域
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
pic_path = path_config.get_screenshot_path()
|
||||
if os.path.exists(pic_path):
|
||||
@@ -1569,11 +1561,7 @@ class FudaiFinder:
|
||||
|
||||
# 保存完整截图用于调试(检测前)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
pic_rgb_full = pic.convert("RGB")
|
||||
|
||||
@@ -1640,11 +1628,7 @@ class FudaiFinder:
|
||||
consecutive_failures = 0
|
||||
# 保存完整截图(检测成功)
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
|
||||
pic_rgb_full = pic.convert("RGB")
|
||||
|
||||
|
||||
+2
-10
@@ -1672,11 +1672,7 @@ def main():
|
||||
|
||||
def on_reset_async_counters():
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
douyin_screenshot_manager.reset_async_save_counters()
|
||||
debug_async_success_var.set(0)
|
||||
debug_async_failure_var.set(0)
|
||||
@@ -1690,11 +1686,7 @@ def main():
|
||||
# 周期性更新计数器(2秒)
|
||||
def _update_async_counters():
|
||||
try:
|
||||
import importlib
|
||||
|
||||
douyin_screenshot_manager = importlib.import_module(
|
||||
"douyin.handlers.douyin_screenshot_manager"
|
||||
)
|
||||
from douyin.handlers import douyin_screenshot_manager
|
||||
s, f = douyin_screenshot_manager.get_async_save_counters()
|
||||
debug_async_success_var.set(s)
|
||||
debug_async_failure_var.set(f)
|
||||
|
||||
+57
-2
@@ -446,13 +446,52 @@ function initFooter() {
|
||||
if (verEl && data?.version) verEl.textContent = "v" + data.version;
|
||||
if (buildEl && data?.build) buildEl.textContent = data.build;
|
||||
} catch (_) {
|
||||
// fallback:从当前 script 的 cache-bust 提取
|
||||
const tag = (document.currentScript?.src || document.querySelector('script[src*="app.js"]')?.src || "")
|
||||
.split("v=")[1] || "";
|
||||
if (verEl) verEl.textContent = tag ? tag.split("-").pop() : "—";
|
||||
if (buildEl) buildEl.textContent = "本地";
|
||||
}
|
||||
})();
|
||||
|
||||
// FPS 计数(每秒更新一次)
|
||||
const fpsEl = document.getElementById("hudFps");
|
||||
if (fpsEl && typeof requestAnimationFrame === "function") {
|
||||
let frames = 0, last = performance.now();
|
||||
const setFps = (n) => {
|
||||
const em = fpsEl.querySelector("em");
|
||||
if (em) em.textContent = String(n);
|
||||
};
|
||||
const tick = (now) => {
|
||||
frames++;
|
||||
if (now - last >= 1000) {
|
||||
setFps(Math.round((frames * 1000) / (now - last)));
|
||||
frames = 0;
|
||||
last = now;
|
||||
}
|
||||
requestAnimationFrame(tick);
|
||||
};
|
||||
requestAnimationFrame(tick);
|
||||
}
|
||||
|
||||
// PING:每 5s 测一次 /api/version 响应时间
|
||||
const pingEl = document.getElementById("hudPing");
|
||||
if (pingEl) {
|
||||
const setPing = (ms) => {
|
||||
const em = pingEl.querySelector("em");
|
||||
if (em) em.textContent = ms === null ? "—" : String(ms);
|
||||
};
|
||||
const ping = async () => {
|
||||
const t0 = performance.now();
|
||||
try {
|
||||
await fetch("/api/version", { cache: "no-store" });
|
||||
setPing(Math.max(1, Math.round(performance.now() - t0)));
|
||||
} catch (_) {
|
||||
setPing(null);
|
||||
}
|
||||
};
|
||||
ping();
|
||||
setInterval(ping, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
function attachCopyButtons() {
|
||||
@@ -1241,6 +1280,21 @@ function renderTimeline(containerId, timeline) {
|
||||
svg.setAttribute("height", String(H));
|
||||
svg.classList.add("timelineSvg");
|
||||
|
||||
// SVG glow filter(feGaussianBlur + feMerge)让折线带霓虹光晕
|
||||
const NS_FILTER = "http://www.w3.org/2000/svg";
|
||||
const defs = document.createElementNS(NS_FILTER, "defs");
|
||||
const filterId = (containerId || "timeline") + "Glow";
|
||||
defs.innerHTML = `
|
||||
<filter id="${filterId}" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feGaussianBlur stdDeviation="1.6" result="blur"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="blur"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
`;
|
||||
svg.appendChild(defs);
|
||||
|
||||
const axis = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
||||
axis.setAttribute("d", `M ${padL} ${H - padB} L ${W - padR} ${H - padB}`);
|
||||
axis.setAttribute("stroke", "var(--border)");
|
||||
@@ -1314,11 +1368,12 @@ function renderTimeline(containerId, timeline) {
|
||||
p.setAttribute("d", d);
|
||||
p.setAttribute("fill", "none");
|
||||
p.setAttribute("stroke", TIMELINE_STROKES[k]?.stroke || "var(--primary)");
|
||||
p.setAttribute("stroke-width", "1.5");
|
||||
p.setAttribute("stroke-width", "1.8");
|
||||
p.setAttribute("stroke-opacity", String(TIMELINE_STROKES[k]?.opacity ?? 1));
|
||||
if (TIMELINE_STROKES[k]?.dash) p.setAttribute("stroke-dasharray", TIMELINE_STROKES[k].dash);
|
||||
p.setAttribute("stroke-linecap", "round");
|
||||
p.setAttribute("stroke-linejoin", "round");
|
||||
p.setAttribute("filter", `url(#${filterId})`);
|
||||
svg.appendChild(p);
|
||||
}
|
||||
|
||||
|
||||
+17
-3
@@ -4,7 +4,10 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>抖音挂机 - Web GUI</title>
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%25' stop-color='%238b95ff'/><stop offset='100%25' stop-color='%235e6ad2'/></linearGradient></defs><rect width='32' height='32' rx='7' fill='url(%23g)'/><path d='M13 10.5v11l9-5.5z' fill='white'/><circle cx='22' cy='10' r='2' fill='white'/></svg>" />
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%25' stop-color='%23f472b6'/><stop offset='100%25' stop-color='%23ec4899'/></linearGradient></defs><rect width='32' height='32' rx='7' fill='url(%23g)'/><path d='M13 10.5v11l9-5.5z' fill='white'/><circle cx='22' cy='10' r='2' fill='white'/></svg>" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap" rel="stylesheet" />
|
||||
<script>
|
||||
(function(){
|
||||
try {
|
||||
@@ -16,7 +19,7 @@
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v24" />
|
||||
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v30" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
@@ -1162,6 +1165,11 @@
|
||||
</div>
|
||||
<div class="preview">
|
||||
<img id="liveShot" alt="实时截图预览" src="/pic/screenshot.png" />
|
||||
<span class="previewBracket previewBracketTL" aria-hidden="true"></span>
|
||||
<span class="previewBracket previewBracketTR" aria-hidden="true"></span>
|
||||
<span class="previewBracket previewBracketBL" aria-hidden="true"></span>
|
||||
<span class="previewBracket previewBracketBR" aria-hidden="true"></span>
|
||||
<span class="previewRec" aria-hidden="true"><span class="previewRecDot"></span>REC</span>
|
||||
<span id="liveShotTs" class="previewTs" hidden></span>
|
||||
<button id="btnShotFullscreen" type="button" class="previewFullscreen" aria-label="全屏查看" data-tooltip="全屏查看" data-tooltip-pos="bottom">
|
||||
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8V3h5"/><path d="M21 8V3h-5"/><path d="M3 16v5h5"/><path d="M21 16v5h-5"/></svg>
|
||||
@@ -1247,8 +1255,14 @@
|
||||
<div class="appFooterLeft">
|
||||
<span class="appConnDot" id="appConnDot" data-state="idle" aria-hidden="true"></span>
|
||||
<span class="appConnText" id="appConnText">就绪</span>
|
||||
<span class="appFooterDivider" aria-hidden="true">·</span>
|
||||
<span class="appFooterMeta">SYS_OK</span>
|
||||
</div>
|
||||
<div class="appFooterRight">
|
||||
<span class="appFooterMeta hudPing" id="hudPing" title="API 响应时间">PING <em>—</em>ms</span>
|
||||
<span class="appFooterDivider" aria-hidden="true">·</span>
|
||||
<span class="appFooterMeta hudFps" id="hudFps" title="渲染帧率">FPS <em>—</em></span>
|
||||
<span class="appFooterDivider" aria-hidden="true">·</span>
|
||||
<span class="appFooterMeta" id="appFooterVersion">v—</span>
|
||||
<span class="appFooterDivider" aria-hidden="true">·</span>
|
||||
<span class="appFooterMeta" id="appFooterBuild">—</span>
|
||||
@@ -1260,6 +1274,6 @@
|
||||
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>
|
||||
</button>
|
||||
|
||||
<script src="app.js?v=console-20260520-theme-v24"></script>
|
||||
<script src="app.js?v=console-20260520-theme-v30"></script>
|
||||
</body>
|
||||
</html>
|
||||
+1088
-352
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user