code wiki / _hdl_build / nx_kvs.nx

nx_kvs.nx

buildroot/runtime/_hdl_build/nx_kvs.nx

12680 B226 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_kvs.nx -- KVS / kt_player URL de-obfuscator. A huge share of "legal personal download" tube sites run the Kernel Video Sharing CMS, which hides the real .mp4 behind an obfuscated flashvars field: video_url: 'function/0/https://host/get_file/3/<SCRAMBLED-32-hex>/aaa/bbb/name_1080p.mp4/' license_code: '$<digits>' The player's kt_player JS un-scrambles the 32-char hash at runtime using license_code -- which is why the real URL only appears in the browser Network tab and our static harvester correctly skips the invalid string. This module reproduces that de-obfuscation EXACTLY (ported verbatim from yt-dlp GenericIE._kvs_get_real_url / _kvs_get_license_token) so we recover the direct URL ourselves. Faithful port -- verified by nx_kvs_gate against a hand-computed token vector + the real bitchesgirls page. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_kvs.nx nx_archive_daemon.nx nx_clean_serve_daemon.nx nx_kvs_gate.nx

imports: nx_syscalls.nx

imported by: nx_archive_daemon.nxnx_clean_serve_daemon.nxnx_kvs_gate.nx

structs

none

consts

11const K_MAGIC_10000: i64 = 10000
12const K_MAGIC_4096: i64 = 4096

functions

14func kvs_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
15func kvs_find(hay: *u8, hl: i64, needle: *u8, nl: i64, from: i64) -> i64
called by 1: kvs_real_url
21func kvs_starts(s: *u8, slen: i64, pre: *u8, prelen: i64) -> i64
called by 1: kvs_real_url
25func kvs_next_slash(s: *u8, slen: i64, from: i64) -> i64
32func kvs_license_token(lic: *u8, llen: i64, tok: *i64) -> i64
called by 1: main calls 1: sys_mmap
88func kvs_real_url(vurl: *u8, vlen: i64, lic: *u8, llen: i64, out: *u8, cap: i64) -> i64
133func kvs_qval(html: *u8, hlen: i64, key: *u8, out: *u8, cap: i64) -> i64
152func kvs_res_score(s: *u8, slen: i64) -> i64
181func kvs_try_field(html: *u8, hlen: i64, field: *u8, lic: *u8, llen: i64, out: *u8, cap: i64) -> i64
189func kvs_label_score(html: *u8, hlen: i64, field: *u8) -> i64
203func kvs_is_prog(u: *u8, ul: i64) -> i64
212func kvs_extract(html: *u8, hlen: i64, out: *u8, cap: i64) -> i64