code wiki / _hdl_build / nx_ia_resolve.nx

nx_ia_resolve.nx

buildroot/runtime/_hdl_build/nx_ia_resolve.nx

5533 B97 linesdepth 23pulls 131 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_ia_resolve.nx -- resolve an archive.org /details/ page to the actual media file URL via the sanctioned public /metadata/ API. A details page is an HTML viewer that loads the media by JS, so a static fetch archives the PAGE, not the movie. This fetches https://archive.org/metadata/<id> (small JSON), reads the top-level "server"+"dir" and the .mp4 (h.264 derivative) filename from "files", and builds the direct download URL. The search engine / archive daemon calls this before preserving an archive.org item. license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_browser_fetch.nx nx_ia_resolve.nx nx_archive_daemon.nx nx_ia_probe.nx

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_browser_fetch.nx

imported by: nx_archive_daemon.nxnx_ia_probe.nx

structs

none

consts

9const K_MAGIC_1024: i64 = 1024
10const K_MAGIC_4194304: i64 = 4194304
11const K_MAGIC_2048: i64 = 2048

functions

13func ia_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: ia_json_str
14func ia_puts(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off }
called by 1: ia_resolve
15func ia_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64
20func ia_identifier(url: *u8, ulen: i64, out: *u8, cap: i64) -> i64
called by 1: ia_resolve calls 1: ia_find
29func ia_json_str(json: *u8, jlen: i64, keyq: *u8, out: *u8, cap: i64) -> i64
called by 1: ia_resolve calls 2: ia_slenia_find
39func ia_find_mp4(json: *u8, jlen: i64, out: *u8, cap: i64) -> i64
called by 1: ia_resolve calls 1: ia_find
58func ia_urlencode(s: *u8, slen: i64, out: *u8, cap: i64) -> i64
72func ia_resolve(details_url: *u8, ulen: i64, store: *TrustStore, cr: *u8, pk: *u8, now: i64, out_url: *u8, cap: i64) -> i64