Commit Graph
62 Commits
Author SHA1 Message Date
OLmatterandClaude Opus 4.7 cd64ff6bab fix(userscript): v8.21.2 inline jitter logic, kill captcha-send loop
Root cause: v8.21 added a top-level `function jitterDelay()` helper.
In some Tampermonkey/cache scenarios the helper is undefined inside
the `handleCaptchaDirectInPage` async closure, throwing
`ReferenceError: jitterDelay is not defined`. The catch block then
resets `captchaSent = false` and `lastCaptchaText = ''`, so the
`setInterval(checkCaptchaPrompt, 50)` loop resends the same captcha
to the backend every 50ms ("dead loop sending captcha").

Fix: inline the ±20% jitter math at both call sites
(line 1814 and 1117), drop the helper entirely. Also added
`Number(...) || default` guards so a stale `CFG.CAPTCHA_CLICK_DELAY`
or `CFG.RL_RETRY_DELAY` of NaN/null/undefined falls back to the
DEF value rather than making `setTimeout(NaN)` fire instantly.

Side effect that confirmed the bug: the captcha bg element lost
its layout during the storm, so `rect.width = 0` and
`nx * rect.width = 0`, but `rect.left` was ~-9992 from a stale
frame ref — hence the marker spamming `(-9992, -10029)`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 23:12:47 +08:00
OLmatterandClaude Opus 4.7 66a9ea559e feat(backend): pipeline GUI launcher + 精简启动器
新增 backend/gui.py Tk 监控窗口:
- 拉起 backend.server 子进程并接管 stdout
- 顶部状态栏(启动中/运行中、YOLO/OCR worker 数、监听地址)
- 中间识别列表(最近 20 条 prompt/pred_text/confidence/耗时)
- 底部日志框(stdout 实时滚动,高亮 worker ready / 错误)
- 关闭窗口自动 terminate 后端

后端新增 /recent?limit=20 端口(GUI 拉取最近识别结果),
/health 同步返回 n_yolo / n_ocr / port 字段。

精简根目录启动器(7 → 2):
- 删 start-backend.cmd / start-backend-pipeline.cmd /
      install-env.cmd / 启动后端.cmd / 首次安装环境.cmd
- 留 one-click-start.cmd(首次装环境)
- 留 start-backend-pipeline-gui.cmd(日常启动 + GUI)
- start-backend-pipeline.ps1 → start-backend-pipeline-gui.ps1

打包脚本 build_portable.ps1 / build_release_zips.ps1 同步
更新入口列表和错误提示。

补 .gitignore: official_models/(81M OCR 模型权重,不入库)

补 scripts/tools/evaluate_pipeline_compare.py(PR #10 评估
脚本,cherry-pick 时漏了)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 22:53:36 +08:00
OLmatterandClaude Opus 4.7 9410388eff feat(userscript): v8.21 高级模式 + 经典模式自带 ±20% 抖动
高级模式(默认关闭)开启后露出两个数字输入框:
- 验证码点击间隔(默认 220ms)
- 限流重试间隔(默认 1000ms)

经典模式(v8.20 行为)也自动加 ±20% 随机抖动,防止
RPM 风控识别。jitterDelay() helper 统一处理。

v8.21.1:黄金时间(9:30-11:00)首次进入时弹紫色条提示
用户试试无痕窗口(Ctrl+Shift+N),消除隐形风控标记。
sessionStorage 去重,当天只弹一次。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 22:12:08 +08:00
OLmatterandClaude Opus 4.7 bdfbf4f1d4 docs: changelog entry for PR #11 BOM fix
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:16:05 +08:00
OLmatterandClaude Opus 4.7 a5394f32d1 fix: add UTF-8 BOM to start-backend-pipeline.ps1
Windows PowerShell 5.1 (the default on most Windows installs) reads
.ps1 files using the system ANSI codepage (GBK on Chinese Windows)
when no BOM is present. UTF-8 Chinese strings like [信息] are then
parsed as invalid characters, causing ParserError at startup.

Symptoms (before fix):
  表达式中缺少字串  (missing string terminator)
  表达式中包含意外的标记 'else'

Adding the EF BB BF BOM tells PowerShell 5.1 to interpret the file
as UTF-8, fixing the parser errors. PowerShell 7+ (pwsh) doesn't
need this, but 5.1 does.

Verified end-to-end: backend starts, /health returns 200 OK,
4 workers (1 YOLO + 3 OCR on 6-core) all ready.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:15:37 +08:00
OLmatterandClaude Opus 4.7 9d6cf6b61d docs: document PR #11 start-backend-pipeline.cmd launcher
Update the pipeline backend section and 常用文件 table to surface
the new double-click launcher, alongside the existing
python backend/server.py invocation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:06:53 +08:00
OLmatterandClaude Opus 4.7 8fb3299a95 docs: changelog entry for PR #11 pipeline launcher
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 21:04:23 +08:00
sunshine 98dfee932d feat(launcher): pipeline backend double-click launcher
- start-backend-pipeline.cmd: double-click entry point
- start-backend-pipeline.ps1: venv auto-detect, dep check (fastapi/uvicorn/psutil),
  auto pip install if missing, Chinese port occupancy prompt with PID/process info,
  user confirmation required before killing existing process
2026-06-15 21:04:08 +08:00
OLmatterandClaude Opus 4.7 bc7f8d7ff8 docs: changelog entry for PR #10 pipeline backend
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 20:58:35 +08:00
sunshineandsunshine 6b052da423 PR A: Pipeline Backend, YOLO to OCR multi-process, CPU auto-allocation (#10)
* feat(pipeline): multi-process YOLO→OCR pipeline backend

- server.py: FastAPI gateway, 3-level mp.Queue pipeline, round-robin dispatch
- worker.py: YOLO character detection worker (core-pinned, single-threaded)
- ppocr_worker.py: PP-OCRv5 recognition worker with pre-warm cache
- evaluate.py: select_fixed3 box selection from scripts/tools/

- Smart CPU core allocation: N_YOLO = cores/4, N_OCR = cores/2
- config.json auto-created on first run (_auto + _cores metadata)
- /health endpoint: {status:'starting'|'ok', workers:N, ready_workers:N}
- Worker watchdog: auto-restart crashed OCR workers
- Shutdown cleanup: _shutdown event + try/finally for orphaned processes

- one_click_start.ps1: pipeline dep check (fastapi/uvicorn/psutil) non-blocking
- setup_backend.py: smoke test includes pipeline deps
- requirements-backend-cpu/gpu.txt: +fastapi, uvicorn[standard], psutil

- README: pipeline architecture + auto CPU allocation
- .gitignore: +config.json, server logs

Minimal verification:
  python -m py_compile backend/server.py backend/worker.py backend/ppocr_worker.py backend/evaluate.py  # OK
  python backend/server.py  →  GET /health  →  {'status':'ok','workers':12,'ready_workers':12}

* fix: review feedback - timeout cleanup, watchdog, health, paddleocr

- handle_direct/handle_direct_url: clean pending_requests on TimeoutError
- _worker_watchdog: always check p.is_alive(), remove ready_count bypass
- /health: add alive_workers field (count is_alive)
- start_backend.ps1: include paddleocr in import check

---------

Co-authored-by: sunshine <qt22260@gmail.com>
2026-06-15 20:57:57 +08:00
OLmatterandClaude Opus 4.7 a1397fca40 chore: bump userscript to v8.20 after PR #17 merge
PR #17 was merged as v8.19 (matching the rush mode feature label),
but our v8.19 was already the golden-time extension. Bump to v8.20
to reflect the combined feature set: golden-time 9:30-11:00 + rush
mode + tabEl 1-index fix + findAndClickConfirm payment-button guard.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 20:40:44 +08:00
sunshineandsunshine 1b090e4bf6 feat(userscript): rush mode v8.19 (rebase from author v8.18) (#17)
- Configurable via panel: enable toggle + HH:MM:SS target time
- checkPayDialog: __glmRushConfirmed guard protects first payment dialog
- tick(): rush lock cleared only when dialog is gone (!getPayDialog)
- handleCaptchaDirectInPage: wait for target time, set rush lock on both
  before-target and already-past branches
- RUSH_CFG reads from user config, parseInt fixed (Number.isFinite guard)

- everSucceeded && PS.bizId (2 locations): prevent stale success
  from keeping sold-out dialogs open
- findAndClickConfirm: removed .pay-dialog/.el-dialog selectors
  (prevent accidental payment button clicks by captcha confirm)
- tabEl: [n] -> [n-1] for correct 1-index to 0-index mapping

- @connect localhost + @connect 127.0.0.1
- Version 8.18 -> 8.19
- Both copies synced, SHA256 identical, whitespace clean

Co-authored-by: sunshine <qt22260@gmail.com>
2026-06-15 20:40:12 +08:00
智商局局长 5d1e797872 fix: patch find_spec to hide torch from modelscope in paddle GPU worker (#19)
PaddleOCR 通过 modelscope 自动探测并加载 torch,但 torch 与 paddle
在同一进程中初始化 CUDA 会触发 pybind11 类型注册冲突
(_gpuDeviceProperties already registered)。

通过 monkey-patch importlib.util.find_spec,对 modelscope 隐藏 torch
的存在,使其跳过 torch 加载,仅在 paddle 进程中生效。

同时补充 cuda_runtime/bin 到 DLL 搜索路径。
2026-06-15 20:22:04 +08:00
OLmatterandClaude Opus 4.7 e07ec9e181 feat: extend golden time to 11:00 (10:30+ still possible per user feedback)
isGoldenTime() now covers 9:30-11:00 (was 9:30-10:10) so late-morning
restock windows are treated as rush mode: no page refresh, no MAX_RL
cap on 555 retries. Bump userscript to v8.19 and add CHANGELOG entry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-15 19:33:55 +08:00
OLmatterandClaude Opus 4.7 514d0b330e docs: warn about RPM risk control and default 2 windows
- change openMultipleWindows prompt default from 3 to 2 (max stays 10)
- add prominent RPM warning box in README rush section after GLM upgraded RPM limits
- strengthen language in step 5 and 重要提醒 from "may trigger" to "has caused widespread failure"
- sync root and scripts/userscripts/ copies

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-14 14:00:42 +08:00
OLmatter 97e2847f87 Add discussion group link to README
Added a link to the discussion group in the README.
2026-06-14 11:08:05 +08:00
OLmatter 08afc38844 fix: allow localhost direct captcha requests 2026-06-13 23:53:31 +08:00
OLmatter 4e5474405c fix: fallback from broken GPU OCR in auto mode v2026.06.13-2102 2026-06-13 19:33:37 +08:00
OLmatter a787a48ee0 feat: add MiniMax token plan referral entry 2026-06-13 19:20:53 +08:00
OLmatter 61b8a91cbe docs: warn about excessive concurrency risk 2026-06-13 13:06:54 +08:00
OLmatter 3bed2c842d fix: harden portable packaging and public docs v2026.06.13-1136 2026-06-13 11:30:49 +08:00
OLmatter 27629a1839 fix: clean userscript prompt and package cmd launchers 2026-06-13 11:23:40 +08:00
OLmatter 152eeb5eca fix: avoid false backend env repair on Windows v2026.06.12-2239 2026-06-12 22:32:22 +08:00
OLmatter f14b4717f4 fix: keep backend python aligned with selected mode v2026.06.11-2208 2026-06-11 21:30:39 +08:00
sunshine 095d1947c7 feat(userscript): fetch-first, GM_xmlhttpRequest fallback
4 network functions changed to try fetch() first, fallback to GM_xmlhttpRequest:
- fetchImageDataUrl
- postDirect
- serverRequest
- fetchCaptchaImageDirect

fetch() has no 6-connection limit per domain (unlike GM_xmlhttpRequest),
eliminating the bottleneck when multiple windows/iframes hit localhost:8888.
GM_xmlhttpRequest is kept as fallback for CORS-restricted contexts.

Both userscript copies synced, SHA256 identical, trailing whitespace cleaned.
2026-06-09 23:18:50 +08:00
OLmatter 70d2b65a70 docs: record backend environment repair release 2026-06-06 20:07:32 +08:00
OLmatter db275068bf fix: repair incomplete backend environment on start v2026.06.06-1749 2026-06-06 17:40:45 +08:00
OLmatter 2f8cc1bf0f Improve rush stability and discount entry 2026-05-29 20:16:22 +08:00
OLmatter ed291db4a5 docs: add OCR comparison appendix 2026-05-28 06:30:56 +08:00
OLmatter a034c2d6c7 Restore userscript install options in README 2026-05-27 21:06:46 +08:00
OLmatter 614cfab2cf Update README for release package workflow 2026-05-27 21:02:39 +08:00
OLmatter d4dd03ed6c Simplify release packaging and direct captcha flow 2026-05-27 20:52:57 +08:00
OLmatter 83e3c12afc fix: detect left aligned captcha modal v2026.05.27-2015 2026-05-27 13:27:40 +08:00
OLmatter ac4b7175df Revise README for clarity and include discount link
Updated README.md to improve clarity and add discount link.
2026-05-27 12:01:34 +08:00
OLmatter 7644c062a5 docs: clarify GPU torch setup and captcha QA 2026-05-27 11:52:23 +08:00
OLmatter e8ec05387e Keep config endpoint backward compatible 2026-05-26 22:44:54 +08:00
OLmatter 2015102f0f Update README to streamline captcha model documentation
Removed outdated captcha model journey documentation and added a reference to it later in the README.
2026-05-26 22:39:00 +08:00
OLmatter 42b2702c79 Revise README for clarity and browser compatibility
Updated project description and installation instructions for clarity.
2026-05-26 22:37:50 +08:00
OLmatter 665dab0be1 Fix backend browser capture compatibility 2026-05-26 22:31:25 +08:00
OLmatter da32cf8201 Refine README content and remove search term redundancy
Removed redundant search terms and clarified project purpose.
2026-05-26 20:55:56 +08:00
OLmatter 89a7d5706a Add captcha model development journey 2026-05-26 11:04:30 +08:00
OLmatter 3b3e0929f2 Simplify README by removing search term details
Removed redundant information about search terms for the project.
2026-05-26 10:19:50 +08:00
OLmatter b5285097be Improve Chinese search keywords 2026-05-26 09:38:05 +08:00
OLmatter 6c3bccd38c Add rush steps to README 2026-05-26 09:11:38 +08:00
OLmatter 0792605db6 Add AI install and repair skill 2026-05-26 08:57:22 +08:00
OLmatter 7e6a1c938d Update README with installation steps for script
Clarify installation instructions for Tampermonkey script.
2026-05-26 08:49:34 +08:00
OLmatter 25471f72bd Revise Tampermonkey script installation steps
Updated installation instructions for Tampermonkey script.
2026-05-26 08:48:58 +08:00
OLmatter fbe9bc9bad Fix typo in Tampermonkey installation instructions 2026-05-26 08:23:54 +08:00
OLmatter ac3f175e4f Update installation instructions for Tampermonkey 2026-05-26 08:22:36 +08:00
OLmatter 395e9decc4 Expose userscript at repository root 2026-05-26 08:18:22 +08:00