# -*- coding: utf-8 -*-
import io, sys, os, json, urllib.request, ssl, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
todo=json.load(open("todo_upgrade.json",encoding="utf-8"))
targets=["Applied Economics","Financial Economics","Biochemistry & Molecular Biology","Environment & Sustainability Management","Cybersecurity Risk Management"]
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
for t in todo:
    if t["s"]=="geo" and t["en"] in targets:
        url=t["url"]
        try:
            req=urllib.request.Request(url,headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"})
            r=urllib.request.urlopen(req,timeout=15,context=ctx); b=r.read(); print(f'{t["en"][:38]:38} {r.status} {len(b)}B {url}')
        except Exception as e:
            print(f'{t["en"][:38]:38} ERR {type(e).__name__} {getattr(e,"code","")} {url}')
