import json

LOCAL = '/images/0926/social_hotspots_4.jpg'
for P in ['/data/news/json/0926data.json', '/data/news/json/yes_data/0925data.json']:
    d = json.load(open(P, encoding='utf-8'))
    if isinstance(d, list):
        d = {s['name']: s['list'] for s in d}
        sec = d['social_hotspots'][4]
        sec['thumb'] = LOCAL
        json.dump([{'name': k, 'list': v} for k, v in d.items()],
                  open(P, 'w', encoding='utf-8'), ensure_ascii=False, indent=2)
    else:
        d['social_hotspots'][4]['thumb'] = LOCAL
        json.dump(d, open(P, 'w', encoding='utf-8'), ensure_ascii=False, indent=2)
    print(f'{P}: social_hotspots[4].thumb → {LOCAL}')
