code wiki / (root) / nx_media_signal.nx

nx_media_signal.nx

buildroot/runtime/nx_media_signal.nx

7116 B115 linesdepth 2pulls 2 transitivereach 52 importersview sourcekind librarytopic media
docsdependenciesstructsconstsfunctions

about

nx_media_signal.nx -- the INTELLIGENT, SITE-RESILIENT media-URL classifier + ranker. Per-site extractors (yt-dlp model) break when a site updates because they hardcode "stream URL = JSON path X on site Y". This keys off UNIVERSAL media signals that survive a site restructure: (a) EXTENSION (.m3u8/.mpd/.mp4/...), (b) PATH pattern (/videoplayback, /master, /manifest, /hls/, /chunklist -- extension-LESS URLs like YouTube's), (c) CDN HOST (googlevideo/cloudfront/akamai/...), (d) media tokens. Multi-signal + confidence- scored + ranked. Combined with the 4-layer fallback (static harvest -> embedded-state -> JS-exec -> multi-round), a site change that breaks ONE signal/layer still resolves via the others. Also smart-naming title extraction (og:title / <title> / "title": -- any of 3 universal signals). license_tier: ORIGINAL

dependencies 1 imports · 25 importers

nx_syscalls.nx nx_media_signal.nx nx_archive_capture.nx nx_archive_capture_gate.nx nx_archive_live.nx nx_clean_serve_daemon.nx nx_cleanwatch_serve.nx nx_extract_heal.nx nx_extract_heal_gate.nx nx_extract_persist_gate.nx nx_media_adapt_gate.nx nx_media_extract.nx

diagram shows first 10 each side; +0 more imports, +15 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_archive_capture.nxnx_archive_capture_gate.nxnx_archive_live.nxnx_clean_serve_daemon.nxnx_cleanwatch_serve.nxnx_extract_heal.nxnx_extract_heal_gate.nxnx_extract_persist_gate.nxnx_media_adapt_gate.nxnx_media_extract.nxnx_media_extract_gate.nxnx_media_nuxt_manifest_gate.nxnx_media_signal_gate.nxnx_sniff_faillog_gate.nxnx_sniff_nsolve_gate.nxnx_surrogate.nxnx_surrogate_gate.nxnx_vk_probe.nxnx_web_filter.nxnx_web_filter_gate.nxnx_yt_basejs.nxnx_yt_basejs_gate.nxnx_yt_nsolve.nxnx_yt_nsolve_gate.nxnx_yt_probe.nx

structs

none

consts

11const XT_NONE: i64 = 0
12const XT_AUDIO: i64 = 1
13const XT_SEGMENT: i64 = 2
14const XT_DASH: i64 = 3
15const XT_DIRECT: i64 = 5 // progressive mp4/webm = directly playable in a native HTML5 <video> -> HIGHEST on the playback path
16const XT_HLS: i64 = 4 // a raw .m3u8 manifest can't play in native <video> yet -> rank BELOW progressive (the HLS assembler will target XT_HLS explicitly)

functions

18func xt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: xt_has
19func xt_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64
25func xt_has(hay: *u8, hl: i64, needle: *u8) -> i64 { if xt_find(hay, hl, needle, xt_slen(needle), 0) >= 0 { return 1 } return 0 }
27func xt_is_cdn(u: *u8, ul: i64) -> i64
called by 1: xt_classify calls 1: xt_has
38func xt_classify(u: *u8, ul: i64, kind: *i64) -> i64
called by 2: xt_bestchk_cls calls 2: xt_hasxt_is_cdn
68func xt_score(kind: i64, conf: i64) -> i64 { return kind * 100 + conf }
called by 2: xh_bestxt_best
70func xt_best(list: *u8, listlen: i64, out: *u8, cap: i64, kind: *i64) -> i64
called by 1: main calls 3: sys_mmapxt_classifyxt_score
103func xt_extract_title(html: *u8, hlen: i64, out: *u8, cap: i64) -> i64
called by 2: mainmain calls 1: xt_find