// THE SHARE LINE (lane output-modes): what a person pastes when they share a // clip -- the recording's own page at the moment (`watchUrlAt`, the link // policy's rule: YouTube `t=s`, Twitch `t=hms`, Rumble // `start=`, else `t=`, over the record's webpage_url), and its moment on // the archive (`archiveMomentUrl`, site-links.mjs: the corner QR's and the // deck's). The moment is the first second the clip plays (its cut, else its // start), floored. // // RUMBLE'S TWO IDS: a channel downloaded from page URLs keeps a recording // under its URL SLUG while the archive serves the EMBED id. `siteVideoFor` // (common videoDir-server.mjs recordIdOfVideoDir: the directory's // metadata.info.json `id`) is the ONE mapping, and its three callers are this // line, `umtool links --fix` (linkCheck.mjs: a Rumble QR naming the folder id // is fixed to the embed id) and `umtool timeline insert /` // (timelineCli.mjs insertClip: the clip is written with its `siteVideo`). A // clip that pins `siteVideo` already is never looked up. // // Plain ESM: the CLI runs it under bare node; the app's share-line route too. import { recordIdOfVideoDir, resolveVideoDirId } from "yt-dlp-transcript-common/lib/videoDir-server.mjs"; import { watchUrlAt } from "yt-dlp-transcript-common/lib/clips/assist.mjs"; import { archiveMomentUrl } from "umtool-report-to-video/site-links"; import { webpageReader } from "./linkPolicy.mjs"; const fin = (v) => typeof v === "number" && Number.isFinite(v); /** * The archive's id for `/