#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""解锁服务器 playwright 后, 启用蒲江+wenshang config"""
import json

path = "/root/gov_crawler/daily_crawl_config.json"
cfg = json.load(open(path, encoding="utf-8"))
changed = 0
for c in cfg:
    if c.get("name") == "蒲江县-环境保护":
        c["enabled"] = True
        c["sync_mode"] = "direct_server"
        c["note"] = "瑞数WAF已服务器playwright过盾, 直接服务器抓取, 前5页"
        changed += 1
        print("✅ 蒲江县-环境保护 → enabled=True")
    elif c.get("name") == "汶上县-公告公示":
        c["enabled"] = True
        c["sync_mode"] = "direct_server"
        c["args"] = "5"
        c["note"] = "服务器playwright列表+urllib详情, 前5页"
        changed += 1
        print("✅ 汶上县-公告公示 → enabled=True")
json.dump(cfg, open(path, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
print(f"修改 {changed} 条, 总数 {len(cfg)}")
