vrh-deopt
v0.1.0
Published
Command line tools for vroidhub-deoptimize
Readme
vrh-deopt
CLI for vroidhub-deoptimize.
Install
npm install -g vrh-deoptInstalled binaries:
vroidhub-deoptimize
vrh-deoptCommands
vrh-deopt restore <input> <output> [flags]
vrh-deopt download <id-or-url> <output> [flags]
vrh-deopt cookie set <cookie>
vrh-deopt cookie status
vrh-deopt cookie clear
vrh-deopt unwrap <input> <output> [flags]
vrh-deopt inspect <url-or-path>IDs
Download accepts either:
- a Hub page model id from
/models/<page-model-id> - a Hub page URL
- a direct CloudFront model URL
Restore metadata uses the internal model id from:
model_optimized_files/<id>/<file>.vrmDo not confuse the page model id with the internal model id.
Cookie
Downloads can read VROIDHUB_COOKIE.
On Windows, the CLI can store it in the user environment:
vrh-deopt cookie set "<cookie>"
vrh-deopt cookie status
vrh-deopt cookie clearcookie status prints the current value.
On Linux and macOS, set the environment variable in your shell:
export VROIDHUB_COOKIE='<cookie>'download
Downloads a model payload and optionally unwraps it.
Decoded GLB/VRM output:
vrh-deopt download "https://hub.vroid.com/en/characters/8203996677873912295/models/5758707318601192662" model.vrmDirect model URL:
vrh-deopt download "https://host/c/v2/s=op/model_optimized_files/4210903/file.vrm" model.vrmEncrypted payload output:
vrh-deopt download "<id-or-url>" payload.bin --encryptedForce API endpoint:
vrh-deopt download "<page-model-id-or-url>" model.vrm --endpoint optimized-preview
vrh-deopt download "<page-model-id-or-url>" model.vrm --endpoint previewFlags:
--endpoint <value> Force optimized-preview or preview.
--encrypted Write encrypted payload instead of decoded GLB/VRM.
--json Print download metadata.
--force Overwrite output files.restore
Restores preview mesh vertices and writes a GLB/VRM buffer.
Input can be:
- raw GLB/VRM
- encrypted payload
- Hub page model id
- Hub page URL
- direct model URL
If raw GLB parsing fails with GLB_MAGIC_MISMATCH, the CLI tries payload unwrap by default.
Restore a local model with URL-derived id/path:
vrh-deopt restore model.vrm restored.vrm \
--url "https://host/c/v2/s=op/model_optimized_files/4210903/file.vrm"Download and restore:
vrh-deopt restore "https://hub.vroid.com/en/characters/8203996677873912295/models/5758707318601192662" restored.vrmManual path:
vrh-deopt restore model.vrm restored.vrm \
--path "model_optimized_files/4210903/file.vrm" \
--optimized trueManual seed:
vrh-deopt restore model.vrm restored.vrm \
--seed 32409552 \
--inc 2352940687395663367Inverse transform:
vrh-deopt restore model.vrm restored.vrm --multiplier -0.125Write intermediate data:
vrh-deopt restore model.vrm restored.vrm \
--url "<direct-model-url>" \
--json \
--metadata metadata.json \
--texture meta.rgbaRestored GLB metadata:
{
"extras": {
"vroidhubInfo": {
"id": "4210903",
"version": "5.0",
"timestamp": "26232110"
}
}
}Flags:
--url <value> Full model URL. Extracts id, path, optimized branch.
--path <value> Model path.
--id <value> Internal model id.
--endpoint <value> Force optimized-preview or preview for URL/id input.
--optimized <bool> Use s=op SHA-1 XOR seed branch.
--timestamp <value> Override extension timestamp.
--version <value> Override extension version.
--seed <value> Manual seed i.
--inc <value> Viewer increment.
--origin <value> RNG origin.
--multiplier <number> Vertex transform multiplier.
--auto-unwrap Try payload unwrap on GLB magic mismatch.
--no-auto-unwrap Disable automatic payload unwrap.
--capture-factors Keep per-vertex transform factors in memory.
--json Print metadata summary.
--metadata <file> Write metadata summary JSON.
--texture <file> Write generated 256x256 RGBA texture bytes.
--force Overwrite output files.unwrap
Only unwraps the outer payload:
vrh-deopt unwrap payload.bin model.vrm --forcePayload layout:
0..15 AES-CBC IV
16..47 AES-256 key
48..end AES-CBC ciphertextDecoded payload:
0..3 uint32 little-endian zstd output size
4..end zstd datainspect
Parses direct model URLs or paths:
vrh-deopt inspect "https://host/c/v2/s=op/model_optimized_files/4210903/file.vrm"Output:
{
"id": "4210903",
"path": "model_optimized_files/4210903/file.vrm",
"optimized": true
}