import json
cfg = json.load(open("/root/gov_crawler/daily_crawl_config.json", "r", encoding="utf-8"))
if isinstance(cfg, dict) and "crawlers" in cfg:
    crawlers = cfg["crawlers"]
else:
    crawlers = cfg

new_entry = {
    "script": "crawl_yncn_tzgg.py",
    "args": "--pages=5",
    "group": "云南省",
    "industry": "政府公告",
    "name": "昌宁县-通知公告",
    "note": "yncn.gov.cn 通知公告(VSB CMS)"
}
crawlers.append(new_entry)
output = cfg if isinstance(cfg, dict) else crawlers
with open("/root/gov_crawler/daily_crawl_config.json", "w", encoding="utf-8") as f:
    json.dump(output, f, ensure_ascii=False, indent=2)
print("Added, total entries:", len(crawlers))
