# -*- coding: utf-8 -*-
import io, sys, os, json, urllib.request, ssl
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
todo={os.path.basename(t["det"]):t for t in json.load(open("todo_upgrade.json",encoding="utf-8"))}
cands=["cmu-c2ee442.html","cmu-c274a8e.html","cmu-c977e17.html","cmu-c8e8fa0.html","cmu-c46c856.html",
       "rice-computer-science.html","rice-data-science.html","rice-statistics.html","rice-electrical-computer-engineering.html",
       "duke-c76be69.html","duke-c710a43.html"]
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
for c in cands:
    t=todo.get(c)
    if not t: print(c,"NOT TODO"); continue
    try:
        req=urllib.request.Request(t["url"],headers={"User-Agent":"Mozilla/5.0"})
        b=urllib.request.urlopen(req,timeout=12,context=ctx).read()
        print(c,"200",len(b),"B",t["en"][:32])
    except Exception as e:
        print(c,"ERR",type(e).__name__,str(e)[:36],t["en"][:28])
