# -*- coding: utf-8 -*-
import 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()
for det in ["details/up-c4e6bf6.html", "details/up-c250a59.html", "details/up-impa.html", "details/up-mph.html", "details/up-smart.html"]:
    print(det, "total occurrences:", idx.count(det))
# check PROGRAMS segment specifically
p_start = idx.find("const PROGRAMS=")
p_end = idx.find("];", p_start)
pseg = idx[p_start:p_end]
print("\n--- in PROGRAMS segment ---")
for det in ["details/up-c4e6bf6.html", "details/up-c250a59.html", "details/up-impa.html", "details/up-mph.html", "details/up-smart.html"]:
    print(det, "in PROGRAMS:", det in pseg)
# check existing det files on disk
import os
for det in ["details/up-c4e6bf6.html", "details/up-c250a59.html"]:
    p = os.path.join(det)
    print(det, "exists on disk:", os.path.exists(p), "size:", os.path.getsize(p) if os.path.exists(p) else 0)
