# -*- 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/jhu-cefa6e1.html","details/jhu-c1d5ed0.html","details/duke-c710a43.html","details/yale-chemical-environmental-engineering.html","details/harvard-engineering-and-applied-sciences.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)
for nid in ["jhu-ehe-ma","jhu-ehe-mse","duke-medphys-ms","yale-che-ms","harvard-seas-sm"]:
    print(nid,"used" if ('{id:"'+nid+'"') in s else "free")
print("last",re.findall(r'\{id:"([^"]+)",[\s\S]*?url:"([^"]+)"',s)[-1])
