code wiki / _hdl_build / nx_yt_innertube.nx
nx_yt_innertube.nx
buildroot/runtime/_hdl_build/nx_yt_innertube.nx
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
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
| 11 | func yt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 12 | func 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 } |
| 13 | func 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 } |
| 15 | func yt_video_id(url: *u8, ulen: i64, out: *u8, cap: i64) -> i64 |
| 25 | func yt_scrape(html: *u8, hlen: i64, field: *u8, out: *u8, cap: i64) -> i64 |
| 34 | func yt_build_body(vid: *u8, vidlen: i64, vd: *u8, vdlen: i64, out: *u8, cap: i64) -> i64 |
| 43 | func yt_build_post(host: *u8, hlen: i64, key: *u8, keylen: i64, vd: *u8, vdlen: i64, body: *u8, blen: i64, out: *u8) -> i64 |
| 58 | func 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 |
| 81 | func yt_innertube(watch_url: *u8, wulen: i64, store: *TrustStore, cr: *u8, pk: *u8, now: i64, out: *u8, cap: i64) -> i64 |
| 89 | func yt_pick_stream(json: *u8, jlen: i64, out: *u8, cap: i64) -> i64 |