code wiki / (root) / nx_yt_transcript.nx

nx_yt_transcript.nx

buildroot/runtime/nx_yt_transcript.nx

16770 B274 linesdepth 24pulls 155 transitivereach 0 importersview sourcekind orphan librarytopic yt
docsdependenciesstructsconstsfunctions

about

nx_yt_transcript.nx -- fetch a YouTube transcript into knowledge/fetched/, provenance-stamped, sovereign from the first byte: the ANDROID_VR InnerTube player response (nx_yt_innertube) yields the captionTracks baseUrl, the shared TLS-1.3 GET (nx_https_fetch_follow) pulls the timedtext body, and nx_yt_captions_lib parses json3/srv1 into `startMs \t durMs \t text`. The WEB baseUrl is a proven dead end (empty 200, needs a proof-of-origin token); the ANDROID client's baseUrl carries no such requirement. nx_yt_transcript <url-or-id> [lang] -> write knowledge/fetched/yt_<id>.<lang>.transcript.txt nx_yt_transcript measure <url-or-id> -> the decisive route (c): player captionTracks + both formats nx_yt_transcript compare <ours> <theirs.json3> -> referee agreement (segment counts + text permil) Refusals by NAME: REFUSED-NO-CAPTIONS, REFUSED-LANG-ABSENT (langs listed), REFUSED-EMPTY-BODY (the pot case). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_yt_captions_lib.nx nx_sha256.nx nx_yt_transcript.nx

imports: nx_syscalls.nxnx_yt_captions_lib.nxnx_sha256.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

15func pw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
16func pn(v: i64) -> i64
25func t_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } return o }
26func t_hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
28func t_hk(doc: *u8, d0: i64, key: *u8) -> i64
38func t_url_lang(url: *u8, out: *u8, cap: i64) -> i64
47func t_norm_url(inp: *u8, out: *u8, cap: i64) -> i64
55func t_title(pj: *u8, jlen: i64, out: *u8, cap: i64) -> i64
67func t_prov(src_url: *u8, mirror: *u8, body: *u8, n: i64) -> i64
93func t_get_player(url: *u8, store: *TrustStore, out_pp: *i64) -> i64
101func do_measure(idurl: *u8, store: *TrustStore) -> i64
133func do_fetch(idurl: *u8, want: *u8, store: *TrustStore) -> i64
211func do_compare(ours_path: *u8, theirs_path: *u8) -> i64
246func ytc_row_count_ours(buf: *u8, len: i64) -> i64
257func main(argc: i64, argv: *i64) -> i64