# -*- coding: utf-8 -*-
import io,sys,os,re,json
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding="utf-8")
B=r"D:\work buddy\2026-11-05-14-15-52"
t=open(os.path.join(B,"index_main.html"),encoding="utf-8").read()
refs=sorted(set(re.findall(r'"(details/[^"]+\.html)"',t)))
json.dump(refs,open(os.path.join(B,"_publish_det.json"),"w",encoding="utf-8"),ensure_ascii=False,indent=0)
print("引用详情页:",len(refs))
# 磁盘核对
miss=[r for r in refs if not os.path.exists(os.path.join(B,r))]
print("磁盘缺失:",len(miss), miss[:5])
