# douyin_fudai_core.py 模块化计划 ## 当前状态 - 文件大小:4720行 - 包含11个主要函数 ## 模块化结构 ### 已创建模块 1. `fudai_debug_utils.py` - 调试工具函数 - `_save_full_screenshot_with_ocr_region` ### 待创建模块 2. `fudai_detail_reader.py` - 福袋详情读取 - `get_fudai_contain` (~1100行) - 辅助函数:`_parse_mm_ss`, `_extract_2digits`, `_read_countdown_split`, `_extract_participants_and_clean` 3. `fudai_attend.py` - 参与抽奖 - `attend_choujiang` (~1200行) 4. `fudai_result_checker.py` - 开奖结果检查 - `check_lucky_draw_result` - `check_have_reward_notice_confirm` - `check_in_order_confirm_page` - `get_reward` 5. `fudai_filter.py` - 过滤判断 - `check_contain` - `is_watch_task_fudai` - `should_skip_fudai_by_config` - `basic_join_decision` (~1500行) ## 迁移策略 ### 阶段1:创建模块结构(当前) - [x] 创建 `douyin/fudai/core/` 目录 - [x] 创建 `fudai_debug_utils.py` - [ ] 创建其他模块骨架 ### 阶段2:提取函数 - [ ] 提取 `get_fudai_contain` 到 `fudai_detail_reader.py` - [ ] 提取 `attend_choujiang` 到 `fudai_attend.py` - [ ] 提取结果检查函数到 `fudai_result_checker.py` - [ ] 提取过滤函数到 `fudai_filter.py` ### 阶段3:更新导入 - [ ] 更新原文件为 `__init__.py`,重新导出所有函数 - [ ] 更新所有导入路径 - [ ] 测试向后兼容性 ### 阶段4:清理 - [ ] 删除原文件中的函数定义(保留导入) - [ ] 添加类型注解 - [ ] 修复Pylance问题 ## 注意事项 - 保持向后兼容:所有现有导入必须继续工作 - 函数依赖关系复杂,需要仔细处理导入 - `get_fudai_contain` 依赖 `_save_full_screenshot_with_ocr_region` - `basic_join_decision` 依赖多个其他函数