# -*- coding: utf-8 -*-
import io, sys, os, re, json
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=")]
have=set(re.findall(r'url:"(details/[^"]+)"',seg))
todo=[x for x in json.load(open("todo_upgrade.json",encoding="utf-8")) if x["s"]=="usc"]
print("USC todo",len(todo))
for x in todo:
    mark="DUP" if x["det"] in have else "NEW"
    print(mark,"|",x["disc"],"|",x["en"][:44],"|",x["det"].split("/")[-1])
