# -*- coding: utf-8 -*-
import re
h = open(r"D:\work buddy\2026-11-05-14-15-52\index_main.html", "r", encoding="utf-8").read()
m = re.search(r"const PROGRAMS\s*=\s*\[", h)
start = m.end()
depth = 1
i = start
while i < len(h) and depth > 0:
    if h[i] == "[": depth += 1
    elif h[i] == "]": depth -= 1
    i += 1
block = h[start:i-1]
entries = re.findall(r'\{id:"([^"]+)"', block)
print("PROGRAMS entries:", len(entries))
usc = sorted(set(e for e in entries if e.startswith("usc-")))
print("usc unique:", len(usc))
for e in usc: print(" ", e)
print()
cmu = sorted(set(e for e in entries if e.startswith("cmu-")))
print("cmu unique:", len(cmu))
for e in cmu: print(" ", e)
