# -*- coding: utf-8 -*-
import io, sys, os, re
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=")]
dets=[
 "details/notre-aerospace-engineering-msae---masters-traditional.html",
 "details/notre-civil-and-environmental-engineering-meng---masters-professional.html",
 "details/notre-civil-engineering-msce---masters-traditional.html",
 "details/notre-civil-engineering-msenve---masters-traditional.html",
 "details/jhu-cd46a5d.html",
]
for d in dets:
    print(d,"| PROG",("IN" if d in s else "no"),"| disk",("exists" if os.path.exists(d) else "absent"),os.path.getsize(d) if os.path.exists(d) else 0)
# id free 核对
for nid in ["notre-msae","notre-cee-meng","notre-msce","notre-msenve","jhu-ehe-ms"]:
    print(nid,"id used" if ('{id:"'+nid+'"') in s else "id free")
last=re.findall(r'\{id:"([^"]+)",[\s\S]*?url:"([^"]+)"',s)[-1]
print("last",last)
