'commit'
This commit is contained in:
@@ -95,13 +95,17 @@ class ReadImageKit:
|
||||
"请仔细检查这张图片中是否存在**弹窗广告**或**悬浮广告**。\n"
|
||||
"广告可能有以下几种形式:\n"
|
||||
"1. **屏幕中央的大型弹窗广告**:通常遮挡了页面内容,内容多为优惠券、活动推广等。\n"
|
||||
"2. **屏幕左侧或右侧的悬浮小广告**:例如带有'活动'、'红包'、'优惠'字样的小图标。\n"
|
||||
"2. **'新电兔AI'专属悬浮广告**(高频):\n"
|
||||
" - **位置范围**:严格锁定在**屏幕左侧边缘**(水平坐标约 0-250),**垂直高度处于中下部**(垂直坐标约 600-900)。\n"
|
||||
" - **视觉特征**:一个卡通兔子头,或带有'新电兔AI'字样的气泡图标。\n"
|
||||
" - **关闭按钮**:务必寻找位于该图标**正下方**的一个**黑色圆形小按钮(内含白色X)**。注意:关闭按钮通常与图标本体分离,悬浮在图标下方约 20-50 像素处。请精确返回这个黑色圆形按钮的中心坐标。\n"
|
||||
"3. **底部的横幅广告**:带有明显的关闭按钮。\n\n"
|
||||
"如果发现了上述任何一种广告,请务必找到该广告的**关闭按钮**(通常是一个'X'符号,或者'关闭'字样,或者位于广告下方/右上角的圆圈叉号)。\n"
|
||||
"请返回该关闭按钮的**中心坐标**。\n\n"
|
||||
"请以纯 JSON 格式输出:\n"
|
||||
"{\n"
|
||||
" \"has_ad\": true/false,\n"
|
||||
" \"ad_type\": \"rabbit\", // \"rabbit\" (新电兔AI/兔子) | \"center\" (中央弹窗) | \"bottom\" (底部横幅) | \"other\"\n"
|
||||
" \"close_point\": [x, y] // 0-1000 归一化坐标\n"
|
||||
"}\n"
|
||||
"如果没有广告,请返回 `{\"has_ad\": false}`。\n"
|
||||
@@ -127,6 +131,9 @@ class ReadImageKit:
|
||||
result = json.loads(raw_json)
|
||||
|
||||
if result.get("has_ad") and result.get("close_point"):
|
||||
if result.get("ad_type") == "rabbit":
|
||||
logger.info("大模型找到了兔子广告!")
|
||||
|
||||
# 转换坐标
|
||||
norm_point = result["close_point"]
|
||||
if len(norm_point) == 2:
|
||||
|
||||
@@ -318,8 +318,18 @@ async def get_station_list(d, service, uploader, max_scrolls=MAX_SCROLLS):
|
||||
logger.info("检测到返回详情页,需执行第二次返回。")
|
||||
should_back_to_list = True
|
||||
else:
|
||||
logger.warning(f"返回后状态未知 (ListMD5:{check_list_md5[:8]} vs {current_md5[:8]}, DetailMD5:{check_detail_md5[:8]} vs {before_click_md5[:8]}),默认执行返回。")
|
||||
should_back_to_list = True
|
||||
logger.warning(f"返回后状态未知 (ListMD5:{check_list_md5[:8]} vs {current_md5[:8]}, DetailMD5:{check_detail_md5[:8]} vs {before_click_md5[:8]})。")
|
||||
logger.info("正在使用 VL 模型进一步确认当前页面状态...")
|
||||
|
||||
# 使用 VL 模型检查当前页面是否存在 '全部时段' 按钮
|
||||
# 如果存在,说明还在详情页,必须返回;如果不存在,说明可能已回到列表页
|
||||
check_res = await ReadImageKit.find_all_time_button_coordinate(check_back_path, device_info=device_info)
|
||||
if check_res and check_res.get("uia_center_x"):
|
||||
logger.info("VL 确认当前仍处于详情页 (发现了'全部时段'按钮),执行返回。")
|
||||
should_back_to_list = True
|
||||
else:
|
||||
logger.info("VL 未发现'全部时段'按钮,判定已回到列表页(或非详情页),停止回退以防误退。")
|
||||
should_back_to_list = False
|
||||
|
||||
else:
|
||||
logger.warning(f"点击 '{station_name}' 的 '全部时段' 按钮后页面无明显变化,跳过三级页面处理。")
|
||||
|
||||
@@ -70,9 +70,13 @@ async def check_and_close_ad(d):
|
||||
|
||||
logger.info(f"VL 检测完成,未发现已知广告。")
|
||||
|
||||
# 清理本地截图
|
||||
# 如果未检测到广告,保留截图以便调试(保存为 debug_ad_failure.jpg)
|
||||
debug_path = os.path.join(os.path.dirname(screenshot_path), "debug_ad_failure.jpg")
|
||||
if os.path.exists(debug_path):
|
||||
os.remove(debug_path)
|
||||
if os.path.exists(screenshot_path):
|
||||
os.remove(screenshot_path)
|
||||
os.rename(screenshot_path, debug_path)
|
||||
logger.info(f"未检测到广告,截图已保存至: {debug_path} (请检查该图片是否真的包含广告)")
|
||||
|
||||
return False
|
||||
|
||||
|
||||
@@ -91,13 +91,17 @@ class ReadImageKit:
|
||||
"请仔细检查这张图片中是否存在**弹窗广告**或**悬浮广告**。\n"
|
||||
"广告可能有以下几种形式:\n"
|
||||
"1. **屏幕中央的大型弹窗广告**:通常遮挡了页面内容,内容多为优惠券、活动推广等。\n"
|
||||
"2. **屏幕左侧或右侧的悬浮小广告**:例如一只兔子形状的图标、红包图标、或者带有'活动'字样的小图标。\n"
|
||||
"2. **'新电兔AI'专属悬浮广告**(高频):\n"
|
||||
" - **位置范围**:严格锁定在**屏幕左侧边缘**(水平坐标约 0-250),**垂直高度处于中下部**(垂直坐标约 600-900)。\n"
|
||||
" - **视觉特征**:一个卡通兔子头,或带有'新电兔AI'字样的气泡图标。\n"
|
||||
" - **关闭按钮**:务必寻找位于该图标**正下方**的一个**黑色圆形小按钮(内含白色X)**。注意:关闭按钮通常与图标本体分离,悬浮在图标下方约 20-50 像素处。请精确返回这个黑色圆形按钮的中心坐标。\n"
|
||||
"3. **底部的横幅广告**:带有明显的关闭按钮。\n\n"
|
||||
"如果发现了上述任何一种广告,请务必找到该广告的**关闭按钮**(通常是一个'X'符号,或者'关闭'字样,或者位于广告下方/右上角的圆圈叉号)。\n"
|
||||
"请返回该关闭按钮的**中心坐标**。\n\n"
|
||||
"请以纯 JSON 格式输出:\n"
|
||||
"{\n"
|
||||
" \"has_ad\": true/false,\n"
|
||||
" \"ad_type\": \"rabbit\", // \"rabbit\" (新电兔AI/兔子) | \"center\" (中央弹窗) | \"bottom\" (底部横幅) | \"other\"\n"
|
||||
" \"close_point\": [x, y] // 0-1000 归一化坐标\n"
|
||||
"}\n"
|
||||
"如果没有广告,请返回 `{\"has_ad\": false}`。\n"
|
||||
@@ -123,6 +127,9 @@ class ReadImageKit:
|
||||
result = json.loads(raw_json)
|
||||
|
||||
if result.get("has_ad") and result.get("close_point"):
|
||||
if result.get("ad_type") == "rabbit":
|
||||
logger.info("大模型找到了兔子广告!")
|
||||
|
||||
# 转换坐标
|
||||
norm_point = result["close_point"]
|
||||
if len(norm_point) == 2:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user