# -*- coding: utf-8 -*-
import io, sys, os, json, re, 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=json.load(open("todo_upgrade.json",encoding="utf-8"))
want=["Finance (MFin)","Master of Management","Master of Marketing","Biomedical Sciences","Biomedical Engineering"]
ctx=ssl.create_default_context()
for t in todo:
    if t["s"]=="vanderbilt" and any(w in t["en"] for w in want):
        url=t["url"]
        try:
            req=urllib.request.Request(url,headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"})
            b=urllib.request.urlopen(req,timeout=12,context=ctx).read()
            print(f'{t["en"][:34]:34} {len(b):7}B {url}')
        except Exception as e:
            print(f'{t["en"][:34]:34} ERR {type(e).__name__} {str(e)[:50]} {url}')
