import re

with open('index_main.html','r',encoding='utf-8') as f:
    html = f.read()

# 5 条详情页路径
new_details = [
    "details/notre-computer-science-and-engineering-mscse---masters-professional.html",
    "details/notre-electrical-engineering-msee---masters-traditional.html",
    "details/notre-mechanical-engineering-msme---masters-traditional.html",
    "details/unc-statistics-analytics-and-data-science-ms.html",
    "details/unc-biomedical-and-health-informatics-ms.html",
]

# 检查是否在 PROGRAMS.url 中
prog_urls = set(re.findall(r'url:"(details/[^"]+\.html)"', html))
print("=== PROGRAMS.url 检查 ===")
for d in new_details:
    in_prog = d in prog_urls
    print(f"  {d}: {'在 PROGRAMS' if in_prog else '不在 PROGRAMS'}")

# 检查是否在 VD 集合中
vd_match = re.search(r'const VERIFIED_DETAILS=new Set\(\[([^\]]+)\]', html)
vd_urls = set()
if vd_match:
    vd_urls = set(re.findall(r'"(details/[^"]+\.html)"', vd_match.group(1)))
print(f"\n=== VD 集合检查（当前 {len(vd_urls)} 条）===")
for d in new_details:
    in_vd = d in vd_urls
    print(f"  {d}: {'在 VD' if in_vd else '不在 VD（需补登）'}")

# 找出需要补登到 VD 的
to_add = [d for d in new_details if d not in vd_urls]
print(f"\n=== 需要补登到 VD 的: {len(to_add)} 条 ===")
for d in to_add:
    print(f"  {d}")
