code wiki / (root) / nx_magnet_discover.nx

nx_magnet_discover.nx

buildroot/runtime/nx_magnet_discover.nx

7622 B166 linesdepth 21pulls 130 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_magnet_discover.nx -- paste a URL, get EVERY magnet on the page + info on each. Fetches the URL over a VALIDATED TLS 1.3 session (nx_https_get + real CA store), scans the response for every "magnet:?" link (decoding HTML &amp; -> &), parses each (info_hash, display name, tracker count) via mg_parse, dedupes by info_hash, and writes a TSV the torrent daemon serves to the UI. The "find all magnets" rung. argv[1] = page URL (https://...) argv[2] = output TSV path out rows: <hash_hex>\t<name>\t<ntrackers>\t<magnet_uri>\n ; plus <out>.status state line. license_tier: ORIGINAL kind: discovery layer: L6 (over validated-HTTPS + magnet-parse) module: nishi-core.torrent.magnet_discover

dependencies 6 imports · 0 importers

nx_magnet.nx nx_https_get.nx nx_x509_trust_store.nx nx_pem_loader.nx nx_csprng.nx nx_syscalls.nx nx_magnet_discover.nx

imports: nx_magnet.nxnx_https_get.nxnx_x509_trust_store.nxnx_pem_loader.nxnx_csprng.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

18const K_MAGIC_1024: i64 = 1024
19const K_MAGIC_1048576: i64 = 1048576
20const K_MAGIC_4096: i64 = 4096
21const K_MAGIC_4095: i64 = 4095

functions

23func md_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: md_status calls 1: sys_write
24func md_wn(fd: i64, v: i64) -> i64
called by 1: md_status calls 2: sys_mmapsys_write
29func md_open_w(path: *u8) -> i64 { return sys_openat_wr(path, 0x1a4) }
called by 1: md_status calls 1: sys_openat_wr
32func md_hex(ihash: *u8, out: *u8) -> i64
40func md_is_term(c: i64) -> i64
54func md_status(outpath: *u8, state: *u8, count: i64, bytes: i64) -> i64
66func main(argc: i64, argv: *i64) -> i64