# -*- coding: utf-8 -*-
import io, re, sys, json
base = r"D:\work buddy\2026-11-05-14-15-52"
s = io.open(base + r"\index_main.html", encoding="utf-8").read()
seg = s[s.index("const PROGRAMS=["):s.index("const CATD=[")]
blocks = re.split(r'(?=\{id:")', seg)[1:]
want = sys.argv[1:]
for b in blocks:
    m = re.search(r'id:"([^"]+)"', b)
    if not m or (want and m.group(1) not in want):
        continue
    print(b[:1400])
    print("-" * 80)
