#!/usr/bin/env python3
"""检查万盛站点中是否有非UI的实际内容图片"""
import sqlite3, re
import os

c = sqlite3.connect(os.getenv("SEARCH_DB", "/root/search.db"))
rows = c.execute("SELECT content FROM gov_raw WHERE site_name LIKE ? AND content LIKE ? AND content NOT LIKE ? LIMIT 5",
    ("%万盛%", "%<img%", "%src=%http%")).fetchall()

found_content_imgs = False
for i, (content,) in enumerate(rows):
    imgs = re.findall(r'<img[^>]+src="([^"]+)"', content)
    content_imgs = [s for s in imgs if "images/" not in s and "znyy" not in s]
    if content_imgs:
        found_content_imgs = True
        print(f"Record {i}: {content_imgs}")
    elif imgs:
        print(f"Record {i}: only UI images: {imgs[:2]}...")

if not found_content_imgs:
    print("No actual content images found in wscq records (all images are UI icons)")
c.close()
