# -*- coding: utf-8 -*-
import io, sys, os, ast
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()

# 1. PROGRAMS 追加 1 条 NYU Biostatistics
new_entry = '{id:"nyu-biostat-ms",s:"nyu",n:"生物统计学硕士（MS）",en:"Master of Science in Biostatistics",dept:"Department of Biostatistics",college:"Global Institute of Public Health (GPH)",disc:"med",lvl:"m",deg:"MS",dur:"在校全日制硕士（SOPHAS 申请，Full-Time Plan）",stem:0,rank:"",test:{cls:"notreq"},ddl:"待补（bulletin 未列）",lang:"待补（TOEFL iBT/IELTS 最低分）",tui:"打包学费待补",url:"details/nyu-c568b0a.html"},'

anchor = 'url:"details/ut-nutr-msc.html"},\n];'
assert anchor in idx, "PROGRAMS anchor not found"
idx = idx.replace(anchor, 'url:"details/ut-nutr-msc.html"},\n' + new_entry + '\n];', 1)

# 2. VD 追加 1 个 det（在 VD 段 ] 前插入）
vd_start = idx.find("const VERIFIED_DETAILS=new Set([")
vd_end = idx.find("]);", vd_start)
vd_new = ',"details/nyu-c568b0a.html"'
idx = idx[:vd_end] + vd_new + idx[vd_end:]

open("index_main.html","w",encoding="utf-8").write(idx)
print("DONE. size:", len(idx))
ast.parse(open(__file__,encoding="utf-8").read())
print("syntax OK")
