// videoDir-server — the disk half of ./videoDirId.mjs: which `data/
/` a
// record's id lives in ON THIS DISK (release 23 F1, the Twitch join, option
// (b)). Plain JS for umtool's bare-node scripts; server-only (node:fs). It
// never computes a path from the cwd: every root arrives as an argument.
import { closeSync, openSync, readdirSync, readFileSync, readSync, statSync } from "node:fs";
import { open, readdir, readFile, stat } from "node:fs/promises";
import path from "node:path";
import { channelConfigPlatform, pickVideoDirId, twitchVodDirId } from "./videoDirId.mjs";
// ---- Rumble's two ids (lane one-clock) -----------------------------------------
//
// A Rumble video has two ids (AGENTS.md). yt-dlp's `id` — what the archive
// serves, what every report and manifest cites — is the EMBED id (`v7drc5w`);
// a channel downloaded from its page URLs names the DIRECTORY for the URL slug
// (`v7fxp3e`, from https://rumble.com/v7fxp3e-title.html). An embed id has no
// directory, so every fetch asked by it went to a `data/