code wiki / _hdl_build / nx_media_state.nx
nx_media_state.nx
buildroot/runtime/_hdl_build/nx_media_state.nx
about
nx_media_state.nx -- EMBEDDED-STATE stream extraction (the yt-dlp / hanime-plugin technique): a modern SSR
site bakes its initial state as a JSON blob in the HTML (window.__NUXT__, ytInitialPlayerResponse,
__INITIAL_STATE__, __NEXT_DATA__, __APOLLO_STATE__), and that blob ALREADY contains the stream URLs -- so
you extract it directly, NO bundle execution needed. This is the cheapest, most robust discovery layer
(below JS-exec). Balanced-brace + string-aware (a `{` inside a JSON string doesn't break the scan). Learned
from cynthia2006/hanime-plugin (deepwiki 2026-07-10): "__NUXT__ state / JSON APIs". license_tier: ORIGINAL
dependencies 1 imports · 10 importers
imports: nx_syscalls.nx
imported by: nx_archive_capture.nxnx_archive_live.nxnx_media_adapt_gate.nxnx_media_extract.nxnx_media_extract_gate.nxnx_media_nuxt_manifest_gate.nxnx_media_state_gate.nxnx_vk_probe.nxnx_yt_innertube.nxnx_yt_probe.nx
structs
| none |
consts
| none |
functions
| 9 | func ms_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: ms_extract_state |
| 10 | func ms_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64 |
| 16 | func ms_contains(hay: *u8, hl: i64, needle: *u8, nl: i64) -> i64 { if ms_find(hay, hl, needle, nl, 0) >= 0 { return 1 } return 0 } |
| 18 | func ms_is_media(u: *u8, ul: i64) -> i64 |
| 32 | func ms_extract_json_value(html: *u8, start: i64, hlen: i64, out: *u8, cap: i64) -> i64 called by 1: ms_extract_state |
| 62 | func ms_extract_state(html: *u8, hlen: i64, marker: *u8, out: *u8, cap: i64) -> i64 |
| 89 | func ms_find_streams(blob: *u8, blen: i64, out: *u8, cap: i64) -> i64 |