# -*- coding: utf-8 -*-
import re, io, sys, os
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
idx = open("index_main.html", encoding="utf-8").read()
seg = idx[idx.find("const PROGRAMS="):idx.find("const CATD=")]
chunks = re.split(r'(?=\{id:")', seg)
for c in chunks:
    if not c.startswith('{id:"'): continue
    if 's:"unc"' not in c: continue
    en = re.search(r'en:"([^"]+)"', c)
    idm = re.search(r'id:"([^"]+)"', c)
    url = re.search(r'url:"([^"]+)"', c)
    print((idm.group(1) if idm else "").ljust(18), "|", (en.group(1) if en else "")[:55].ljust(55), "|", (url.group(1) if url else ""))
