import urllib.request import os import ssl import zipfile import io ssl._create_default_https_context = ssl._create_unverified_context inter_url = "https://github.com/rsms/inter/releases/download/v4.0/Inter-4.0.zip" print(f"Downloading Inter from {inter_url}") try: req = urllib.request.Request(inter_url, headers={'User-Agent': 'Mozilla/5.0'}) with urllib.request.urlopen(req) as response: with zipfile.ZipFile(io.BytesIO(response.read())) as z: for info in z.infolist(): if info.filename.endswith("Inter-Regular.ttf") or info.filename.endswith("Inter-Bold.ttf"): info.filename = os.path.basename(info.filename) z.extract(info, "assets/fonts/") print(f"Extracted {info.filename}") except Exception as e: print(f"Failed to get Inter: {e}")