Files
douyin_guaji-main/douyin
CodexandClaude Opus 4.7 c442335b34 拆分 douyin_stage_handler (1009 → 5 个子模块 + 26 行 shim)
把 douyin/stage/douyin_stage_handler.py 的 StageHandler 类(4 个
@staticmethod)拆成 douyin/stage/douyin_stage_handler_pkg/ 子包:

- diagnose (37)        diagnose_stage_from_current_screen 阶段诊断分发
- check_live (774)     check_in_live_room_by_icon 直播间图标检测(最大头)
- handle_detail (20)   handle_in_fudai_detail 福袋详情页处理
- handle_room (195)    handle_live_room_has_or_not_fudai 直播间福袋检测分发
- handler (32)         StageHandler 类(薄壳,每个方法 1 行 forwarding)

策略:4 个方法都是 @staticmethod 第一参数 analyser,搬到 module-level 后
类方法变成 1 行 forwarding。类内部 0 互调,外部 3 处 StageHandler.method
(douyin_fudai.py / fudai_stage_detection.py)保持不变。

外部 import 路径不变:
``from douyin.stage.douyin_stage_handler import StageHandler`` 仍可用。

回归:
- 6 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- StageHandler.diagnose / module-level diagnose 都正确指向 wrapper / 实现

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:36:41 +08:00
..

抖音挂机核心模块

本目录包含项目的所有核心业务代码,按功能模块组织。

目录结构

  • core/ - 核心调度和流程控制

    • douyin_fudai.py - 主调度器
    • douyin_main_flow.py - 主流程控制
    • douyin_flow_control.py - 流程控制
  • stage/ - 阶段处理

    • douyin_stage.py - 阶段定义
    • douyin_stage_handler.py - 阶段处理器
  • fudai/ - 福袋相关

    • douyin_fudai_core.py - 福袋核心逻辑
    • douyin_fudai_detail.py - 福袋详情处理
    • douyin_fudai_finder.py - 福袋查找器
    • douyin_fudai_flow.py - 福袋流程
  • detection/ - 检测相关

    • douyin_detection.py - 检测模块
    • douyin_pixel.py - 像素检测
  • reservation/ - 预约相关

    • douyin_reservation.py - 预约主模块
    • douyin_reservation_logic.py - 预约逻辑
    • douyin_reservation_handler.py - 预约处理器
    • douyin_reservation_ops.py - 预约操作
    • douyin_reservation_verify.py - 预约验证
  • handlers/ - 处理器模块

    • douyin_popup_handler.py - 弹窗处理器
    • douyin_screenshot_handler.py - 截图处理器
    • douyin_screenshot_manager.py - 截图管理器
    • douyin_swipe_handler.py - 滑动处理器
    • douyin_swipe_ops.py - 滑动操作
  • utils/ - 工具函数

    • douyin_config.py - 配置管理
    • douyin_helpers.py - 辅助函数
    • douyin_text_utils.py - 文本工具
    • douyin_utils.py - 通用工具
  • logging/ - 日志相关

    • douyin_logging.py - 日志配置
    • douyin_logging_wrapper.py - 日志包装器
    • douyin_logger.py - 日志器
  • other/ - 其他功能模块

    • douyin_guaji.py - 挂机主模块
    • douyin_high_value_room.py - 高价值房间
    • douyin_live_room.py - 直播间
    • douyin_lottery.py - 抽奖
    • douyin_popups.py - 弹窗
    • douyin_robot.py - 机器人
    • douyin_stuck_guard.py - 卡顿守护
    • douyin_yanghao.py - 养号

导入方式

所有模块都可以通过 douyin 包导入,例如:

from douyin.core.douyin_fudai import fudai_analyse
from douyin.utils.douyin_utils import normalize_countdown_text
from douyin.handlers.douyin_swipe_handler import SwipeHandler