code wiki / _hdl_build / nx_manga_search.nx

nx_manga_search.nx

buildroot/runtime/_hdl_build/nx_manga_search.nx

21130 B371 linesdepth 21pulls 148 transitivereach 2 importersview sourcekind librarytopic manga
docsdependenciesstructsconstsfunctions

about

nx_manga_search.nx -- the SOURCE BROWSER backend (operator 2026-07-04: "i want the sites to choose to download or translate like i could in media manager"). On-site SEARCH for the sources we support, served to the /library/manga page so the operator picks a source, searches it, and taps a result to download -- the Mihon/media-manager model. /api/msearch?src=mangadex&q=.. -> MangaDex API (/manga?title=) -> [{t,id,thumb,kind:series}] /api/msearch?src=nhentai&q=.. -> nhentai /search/ HTML (its old API is 403'd) -> [{t,url,thumb,kind:gallery}] /api/mfeed?id=<mangaId> -> MangaDex chapter feed -> [{ch,t,id}] (series -> chapters second level) /api/thumb?u=<enc url> -> PROXY a cover through our sovereign Chrome client (beats Cloudflare/hotlink), so thumbnails ALWAYS render in the browser regardless of referer checks. All live fetches via nx_https_fetch_follow_chrome (Chrome-JA3 + RSA-PSS + honest UA). Parsers match REAL shapes captured with the sovereign client. Reuses na_* (nx_manga_sites) + zs_* (nx_reader_zoomserve). license_tier: ORIGINAL

dependencies 6 imports · 2 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_manga_sites.nx nx_reader_zoomserve.nx nx_manga_search.nx nx_manga_search_gate.nx nx_media_server.nx

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nxnx_manga_sites.nxnx_reader_zoomserve.nx

imported by: nx_manga_search_gate.nxnx_media_server.nx

structs

none

consts

17const MSS_MAGIC_4194304: i64 = 4194304
18const MSS_MAGIC_1536: i64 = 1536
19const MSS_MAGIC_2048: i64 = 2048
20const MSS_MAGIC_1024: i64 = 1024
22const MSS_FETCH_CAP: i64 = 2097152 // 2MB (mangadex/nhentai search pages ~40KB; covers up to ~1MB)
23const MSS_OUT_CAP: i64 = 131072

functions

25func mss_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: mss_handle_thumb
28func mss_qenc(src: *u8, n: i64, out: *u8) -> i64
called by 1: mss_handle_search
47func mss_at(buf: *u8, n: i64, pos: i64, lit: *u8) -> i64
55func mss_cpjval(dst: *u8, o: i64, src: *u8, from: i64, n: i64, cap: i64, endp: *i64) -> i64
called by 1: msearch_mangadex
66func mss_jesc(dst: *u8, o: i64, src: *u8, from: i64, to: i64, cap: i64) -> i64
called by 1: msearch_mangadex
78func mss_thumb_field(dst: *u8, o: i64, real: *u8, us: i64, ue: i64, cap: i64) -> i64
called by 1: msearch_mangadex calls 1: zs_apps
95func msearch_mangadex(json: *u8, jn: i64, out: *u8, cap: i64) -> i64
156func msearch_nhentai(html: *u8, hn: i64, out: *u8, cap: i64) -> i64
204func mfeed_mangadex(json: *u8, jn: i64, out: *u8, cap: i64) -> i64
240func mss_urldec(enc: *u8, n: i64, dst: *u8) -> i64
257func mss_store() -> i64 { return nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, MSS_MAGIC_4194304) }
260func mss_emit_results(cfd: i64, url: *u8, is_md: i64) -> i64
295func mss_handle_browse(cfd: i64, path: *u8, plen: i64) -> i64
314func mss_handle_random(cfd: i64, path: *u8, plen: i64) -> i64
325func mss_handle_feed(cfd: i64, path: *u8, plen: i64) -> i64
344func mss_handle_thumb(cfd: i64, path: *u8, plen: i64) -> i64