#!/usr/bin/env python3
"""Remove duplicate chuzhou config entry"""
import json

config_path = '/root/gov_crawler/daily_crawl_config.json'

with open(config_path, 'r', encoding='utf-8') as f:
    config = json.load(f)

# Find and remove the duplicate entry I added
original_count = len(config['crawlers'])
config['crawlers'] = [c for c in config['crawlers'] if c.get('script') != 'crawl_chuzhou_gsgg.py']
removed = original_count - len(config['crawlers'])

if removed:
    with open(config_path, 'w', encoding='utf-8') as f:
        json.dump(config, f, ensure_ascii=False, indent=2)
    print(f"Removed {removed} duplicate entry")
else:
    print("No duplicate entry found")

print(f"Total crawlers: {len(config['crawlers'])}")
