# -*- coding: utf-8 -*-
import sys, io, re, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
BASE = r"D:\work buddy\2026-11-05-14-15-52"
h = open(os.path.join(BASE,"index_main.html"), encoding="utf-8").read()
i = h.index("const PROGRAMS=["); j = h.index("const CATD=[", i)
seg = h[i:j]
pat = re.compile(r'\{id:"([^"]+)"([\s\S]*?)(?=\{id:"|$)', re.M)
W = ["ucla-ms-cs","ucla-ece-ms","ucla-mse-ece","ucla-ms-me","ucla-aero-ms","ucla-stats-ms","ucla-biostat-ms","ucla-slavic-ma"]
for m in pat.finditer(seg):
    bid = m.group(1)
    if bid not in W: continue
    body = m.group(2)
    u = re.search(r'url:"([^"]*)"', body)
    fp = os.path.join(BASE, u.group(1).replace("/", os.sep))
    sz = os.path.getsize(fp) if os.path.exists(fp) else -1
    print(f"{bid:22s} {sz:>7d}  {u.group(1)}")
