# -*- coding: utf-8 -*-
import io, sys, os, re, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
t=open("index_main.html",encoding="utf-8").read()
s=t[t.find("const PROGRAMS="):t.find("const CATD=")]
print("=== 库内 PROGRAMS 中 uw 条目 ===")
for m in re.finditer(r'\{id:"([^"]+)",[\s\S]*?url:"([^"]+)"', s):
    if m.group(1).startswith("uw-"):
        print(m.group(1), "|", m.group(2))

cand=["uw-c435976.html","uw-cb1d654.html","uw-cb1705c.html"]
progdets=set(re.findall(r'url:"(details/[^"]+)"',s))
catd=t[t.find("const CATD="):t.find("const VERIFIED_DETAILS=")]
catddets=set(re.findall(r'"(details/[^"]+)"',catd))
print("\n=== 候选去重 ===")
for d in cand:
    det="details/"+d
    print(d, "IN_PROG" if det in progdets else "not in PROG", "| in CATD" if det in catddets else "| not in CATD")
