code wiki / _hdl_build / nx_yt_innertube.nx

nx_yt_innertube.nx

buildroot/runtime/_hdl_build/nx_yt_innertube.nx

8291 B103 linesdepth 22pulls 131 transitivereach 0 importersview sourcekind orphan librarytopic yt
docsdependenciesstructsconstsfunctions

about

nx_yt_innertube.nx -- the RELIABLE YouTube path, done yt-dlp's way: SCRAPE the live INNERTUBE_API_KEY + visitorData from the watch page's ytcfg (they rotate -- hardcoding them precondition-fails), then POST the ANDROID-client /youtubei/v1/player request with the scraped key + visitorData, over our own TLS-1.3. Parse streamingData.formats[].url (progressive, directly playable). This self-heals against Google's key rotation -- the same technique yt-dlp uses. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_https_get_spoof.nx nx_https_get_complete.nx nx_media_state.nx nx_yt_innertube.nx

imports: nx_syscalls.nxnx_https_get_spoof.nxnx_https_get_complete.nxnx_media_state.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

11func yt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
12func yt_puts(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off]=s[i];off=off+1;i=i+1} return off }
13func yt_putn(dst: *u8, off: i64, v: i64) -> i64 { var m: i64=v; if m==0 { dst[off]=48 as u8; return off+1 } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } var j: i64=0; while j<k { dst[off]=t[k-1-j]; off=off+1; j=j+1 } return off }
called by 1: yt_build_post calls 1: sys_mmap
15func yt_video_id(url: *u8, ulen: i64, out: *u8, cap: i64) -> i64
called by 1: yt_innertube calls 1: ms_find
25func yt_scrape(html: *u8, hlen: i64, field: *u8, out: *u8, cap: i64) -> i64
calls 2: yt_slenms_find
34func yt_build_body(vid: *u8, vidlen: i64, vd: *u8, vdlen: i64, out: *u8, cap: i64) -> i64
called by 1: yt_innertube calls 1: yt_puts
43func yt_build_post(host: *u8, hlen: i64, key: *u8, keylen: i64, vd: *u8, vdlen: i64, body: *u8, blen: i64, out: *u8) -> i64
called by 1: yt_post calls 2: yt_putsyt_putn
58func yt_post(host_url: *u8, key: *u8, keylen: i64, vd: *u8, vdlen: i64, body: *u8, blen: i64, store: *TrustStore, cr: *u8, pk: *u8, now: i64, out: *u8, cap: i64) -> i64
81func yt_innertube(watch_url: *u8, wulen: i64, store: *TrustStore, cr: *u8, pk: *u8, now: i64, out: *u8, cap: i64) -> i64
89func yt_pick_stream(json: *u8, jlen: i64, out: *u8, cap: i64) -> i64