Codex and Claude Sonnet 4.5
bb90e2983f
fix(pil): 补充修复剩余 PIL Image 资源泄漏
...
覆盖 14 个文件中的 Image.open() 未正确关闭问题:
- fansclub_handler: 5 处(pic/pic_rgb/img 未 close)
- image_ops: 2 处(crop 后 pic 未 close)
- douyin_popups: 2 处(pic.convert 重赋值泄漏原始句柄)
- douyin_fudai: 1 处(open().convert() 链式调用泄漏)
- douyin_robot: 2 处(同上)
- save_files/direct_attend/finder/stage/find_open/detail/_common/ocr_preprocess: 各 1-2 处
统一修复模式:分离 open 与 convert,try/finally 确保原始句柄关闭。
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-05-23 22:49:50 +08:00
Codex
842dd254e3
fix: correct import path for check_detail_height in detect_fudai_detail_page
...
The relative import from .douyin_detection was looking in the
douyin/detection/pixel/ package, but douyin_detection.py lives
at douyin/detection/douyin_detection.py. This caused every fudai
detail page detection to fail with detection_exception, making the
system always treat successful detail page opens as misclicks.
2026-05-23 17:05:43 +08:00
Codex and Claude Opus 4.7
c0b8ff3ba6
拆分 douyin_pixel (1172 → 4 个子模块 + 33 行 shim)
...
把 douyin/detection/douyin_pixel.py 按职责拆成
douyin/detection/pixel/ 子包:
- _common (32) _safe_open_screenshot_rgb
- popups (444) 优惠券 / 红包 / 抽奖结果弹窗检测
- buttons (340) 参与按钮 / 粉丝团加入红色区域检测
- stage (436) 直播间图标 / 福袋详情 / 综合阶段状态读取
原文件改为 33 行 re-export shim,9 个公共符号全部保留。
detect_fudai_detail_page 等 6 处外部引用、detect_attend_button_red_area
等 2 处外部引用全部不需修改。
回归:
- 5 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 16:37:06 +08:00