import json, io, os
BASE = "/data/www/files"
d = json.load(io.open(os.path.join(BASE, "curated_0925.json"), encoding="utf-8"))
for i, r in enumerate(d, 1):
    r["idx"] = i
    r["budget"] = r.get("budget_hint") or "未披露"
    r["type"] = r.get("info_type")
json.dump(d, io.open(os.path.join(BASE, "projects_20260925.json"), "w", encoding="utf-8"),
          ensure_ascii=False, indent=1)
for dd in ("screenshots", "snapshots"):
    os.makedirs(os.path.join(BASE, dd, "20260925"), exist_ok=True)
print("projects:", len(d))
print("shot dir:", os.path.isdir(os.path.join(BASE, "screenshots", "20260925")))
