import re, os
base = os.path.dirname(os.path.abspath(__file__))
html = open(os.path.join(base, "index_main.html"), encoding="utf-8").read()
seg = re.search(r"const PROGRAMS\s*=\s*\[(.*?)\];", html, re.S).group(1)
blocks = re.findall(r"\{id:\"([^\"]+)\"([\s\S]*?)(?=\{id:\"|$)", seg)
bmap = {bid: body for bid, body in blocks}
vd = set(re.findall(r'"(details/[^"]+\.html)"', re.search(r"const VERIFIED_DETAILS[^;]+;", html).group(0)))
for bid in ["umich-aero-mse", "uva-msacc"]:
    body = bmap[bid]
    def f(k):
        mm = re.search(k + r':"([^"]*)"', body)
        return mm.group(1) if mm else None
    url = f("url")
    print(bid, "| lvl=", f("lvl"), "deg=", f("deg"), "| n=", f("n"), "| en=", f("en"))
    print("   url=", url, "| disk=", os.path.exists(os.path.join(base, url)), "| vd=", url in vd)
