This commit is contained in:
HuangHai
2026-01-12 22:20:11 +08:00
parent 66be7cba86
commit 66c0046d2b
12 changed files with 11 additions and 305 deletions

View File

@@ -28,6 +28,17 @@ async def check_and_close_ad(d):
"""
logger.info("开始检测广告弹窗 (VL方案)...")
# [新增] 策略:先向上滑动一点,触发悬浮广告(如兔子)收起/躲避
try:
w, h = d.window_size()
logger.info(f"执行微小滑动 (Swipe Up),尝试触发悬浮广告收起...")
# 从 70% 处滑到 50% 处,模拟手指上滑,页面内容上移
d.swipe(w * 0.5, h * 0.7, w * 0.5, h * 0.5, duration=0.3)
# 等待滑动动画结束和广告收起动画
await asyncio.sleep(0.5)
except Exception as e:
logger.warning(f"滑动操作异常: {e}")
# 1. 拍摄截图
t1 = time.time()
image_uuid = str(uuid.uuid4())