nx_media_signal.nx
buildroot/runtime/nx_media_signal.nx
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
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
| 11 | const XT_NONE: i64 = 0 |
| 12 | const XT_AUDIO: i64 = 1 |
| 13 | const XT_SEGMENT: i64 = 2 |
| 14 | const XT_DASH: i64 = 3 |
| 15 | const XT_DIRECT: i64 = 5 // progressive mp4/webm = directly playable in a native HTML5 <video> -> HIGHEST on the playback path |
| 16 | const 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
| 18 | func 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 |
| 19 | func xt_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64 |
| 25 | func xt_has(hay: *u8, hl: i64, needle: *u8) -> i64 { if xt_find(hay, hl, needle, xt_slen(needle), 0) >= 0 { return 1 } return 0 } |
| 27 | func xt_is_cdn(u: *u8, ul: i64) -> i64 |
| 38 | func xt_classify(u: *u8, ul: i64, kind: *i64) -> i64 |
| 68 | func xt_score(kind: i64, conf: i64) -> i64 { return kind * 100 + conf } |
| 70 | func xt_best(list: *u8, listlen: i64, out: *u8, cap: i64, kind: *i64) -> i64 |
| 103 | func xt_extract_title(html: *u8, hlen: i64, out: *u8, cap: i64) -> i64 |