fix(countdown): 修复长倒计时被截断到15分钟的bug

check_countdown 中 >900s 的上限过于激进,将实际的58分钟福袋截断到14:50。
改为 >3600s(1小时)上限,兼容抖音的60分钟福袋。

同时修复 _extract_digits 取后N位的问题,改为取前N位,
避免当子图意外捕获额外数字时(如 "1458")被误提取为 "58"。

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
CodexandClaude Sonnet 4.5 committed 2026-05-23 19:22:20 +08:00
1 parent a50f08de5a
commit df69c6ab67
6 files changed
+113 -73

No files matched your search

+3 -3
View File
@@ -145,12 +145,12 @@ class TestCheckCountdown:
assert check_countdown("xyz") is False
def test_overlong_capped(self):
"""超过 15 分钟的输入会被截断到 14分50秒,避免误识别卡死。"""
"""超过 60 分钟的输入会被截断到 59分50秒,避免误识别卡死。"""
result = check_countdown("99:99")
if result is not False:
seconds, _ = result
# 实际逻辑:>900 截到 890
assert seconds <= 900
# 实际逻辑:>3600 截到 3590
assert seconds <= 3600
def test_ocr_char_corrections(self):
"""O→0, l→1 等字符纠错。"""