- Deleted obsolete files including test scripts and configuration files to streamline the project. - Introduced new modules for handling Douyin functionalities, including core operations, logging, and GUI components. - Updated import paths to reflect the new module structure, enhancing code organization and maintainability. - Added configuration files and documentation to support the new structure and improve user guidance.
45 lines
1.0 KiB
Python
45 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
"""
|
|
弹窗处理模块
|
|
============
|
|
|
|
职责:弹窗检测和处理
|
|
- 检测优惠券弹窗
|
|
- 检测购物红包弹窗
|
|
"""
|
|
|
|
from typing import Any
|
|
|
|
from douyin.other import douyin_popups
|
|
|
|
|
|
class PopupHandler:
|
|
"""弹窗处理器:统一管理弹窗处理"""
|
|
|
|
@staticmethod # type: ignore[misc]
|
|
def check_coupon_popup(analyser: Any) -> bool:
|
|
"""购物券 / 新客专享券 等底部营销弹窗(仅在详情链路外的"看门狗"中使用)。
|
|
|
|
参数:
|
|
analyser: 分析器对象
|
|
|
|
返回:
|
|
bool: 是否检测到弹窗
|
|
"""
|
|
return douyin_popups.check_coupon_popup(analyser)
|
|
|
|
@staticmethod # type: ignore[misc]
|
|
def check_shopping_redpacket_popup(analyser: Any) -> bool:
|
|
"""购物红包中央弹窗。
|
|
|
|
参数:
|
|
analyser: 分析器对象
|
|
|
|
返回:
|
|
bool: 是否检测到弹窗
|
|
"""
|
|
return douyin_popups.check_shopping_redpacket_popup(analyser)
|
|
|
|
|