code wiki / _hdl_build / nx_manga_search.nx
nx_manga_search.nx
buildroot/runtime/_hdl_build/nx_manga_search.nx
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
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
| 17 | const MSS_MAGIC_4194304: i64 = 4194304 |
| 18 | const MSS_MAGIC_1536: i64 = 1536 |
| 19 | const MSS_MAGIC_2048: i64 = 2048 |
| 20 | const MSS_MAGIC_1024: i64 = 1024 |
| 22 | const MSS_FETCH_CAP: i64 = 2097152 // 2MB (mangadex/nhentai search pages ~40KB; covers up to ~1MB) |
| 23 | const MSS_OUT_CAP: i64 = 131072 |
functions
| 25 | func 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 |
| 28 | func mss_qenc(src: *u8, n: i64, out: *u8) -> i64 called by 1: mss_handle_search |
| 47 | func mss_at(buf: *u8, n: i64, pos: i64, lit: *u8) -> i64 |
| 55 | func mss_cpjval(dst: *u8, o: i64, src: *u8, from: i64, n: i64, cap: i64, endp: *i64) -> i64 called by 1: msearch_mangadex |
| 66 | func mss_jesc(dst: *u8, o: i64, src: *u8, from: i64, to: i64, cap: i64) -> i64 called by 1: msearch_mangadex |
| 78 | func mss_thumb_field(dst: *u8, o: i64, real: *u8, us: i64, ue: i64, cap: i64) -> i64 |
| 95 | func msearch_mangadex(json: *u8, jn: i64, out: *u8, cap: i64) -> i64 |
| 156 | func msearch_nhentai(html: *u8, hn: i64, out: *u8, cap: i64) -> i64 |
| 204 | func mfeed_mangadex(json: *u8, jn: i64, out: *u8, cap: i64) -> i64 |
| 240 | func mss_urldec(enc: *u8, n: i64, dst: *u8) -> i64 |
| 257 | func mss_store() -> i64 { return nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, MSS_MAGIC_4194304) } |
| 260 | func mss_emit_results(cfd: i64, url: *u8, is_md: i64) -> i64 |
| 272 | func mss_handle_search(cfd: i64, path: *u8, plen: i64) -> i64 |
| 295 | func mss_handle_browse(cfd: i64, path: *u8, plen: i64) -> i64 |
| 314 | func mss_handle_random(cfd: i64, path: *u8, plen: i64) -> i64 |
| 325 | func mss_handle_feed(cfd: i64, path: *u8, plen: i64) -> i64 |
| 344 | func mss_handle_thumb(cfd: i64, path: *u8, plen: i64) -> i64 |