# -*- coding: utf-8 -*-
import io,sys,os,re,json,ssl,urllib.request,urllib.error
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding="utf-8")
b=r"D:\work buddy\2026-11-05-14-15-52"
todo=json.load(open(os.path.join(b,"todo_upgrade.json"),encoding="utf-8"))
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
def head(u):
    try:
        req=urllib.request.Request(u,headers={"User-Agent":"Mozilla/5.0"})
        r=urllib.request.urlopen(req,timeout=12,context=ctx)
        bb=r.read()
        return r.status,len(bb)
    except urllib.error.HTTPError as e:
        return e.code,0
    except Exception as e:
        return "ERR:"+type(e).__name__,0
seen={}
for t in todo:
    s=t["s"]
    if s in seen: continue
    seen[s]=t
for s,t in seen.items():
    st,n=head(t["url"])
    print(f"{s:10} {st} {n:6} {t['url'][:70]}")
