MCPcopy Create free account
hub / github.com/0xcaff/codex-web / download_enclosure

Function download_enclosure

scripts/fetch_updates/fetch_updates.py:39–53  ·  view source on GitHub ↗
(enclosure: etree._Element, dest: Path)

Source from the content-addressed store, hash-verified

37
38
39def download_enclosure(enclosure: etree._Element, dest: Path) -> None:
40 url = urljoin(APPCAST_URL, enclosure.attrib["url"])
41 ed_signature = enclosure.attrib[sparkle_name("edSignature")]
42
43 with requests.get(url, timeout=120) as resp:
44 resp.raise_for_status()
45 data = resp.content
46
47 try:
48 verify_sparkle_signature(data, ed_signature)
49 except RuntimeError as e:
50 print(f"warning {e} for {url}")
51
52 dest.parent.mkdir(parents=True, exist_ok=True)
53 dest.write_bytes(data)
54
55
56def appcast_snapshot_path(output_root: Path) -> Path:

Callers 1

process_itemFunction · 0.85

Calls 2

sparkle_nameFunction · 0.85
verify_sparkle_signatureFunction · 0.85

Tested by

no test coverage detected