// A SYNTHETIC MIRROR CORPUS (release 31, lane D) — a creator who streams on // two platforms and a channel that archives the streams on a third. Invented // names, titles and ids; nothing from a real channel. // // synth-streamer the creator on "youtube": three streams (one public, // one deleted, one private), a removed short outside // the mirror's window, a removed short inside it that // the mirror does not hold, a public video nothing // matches. // synth-streamer-rumble the creator's "rumble" twin: copies of the public and // the deleted stream, and a stream never on YouTube. // Rumble's data dirs are URL slugs, its ids embed ids. // synth-vod-archive the MIRROR ("odysee"): titles // "[VOD] SynthStreamer - MM/DD/YYYY - ", uploaded // days after the stream; one title with no date (dated // by its upload). config `recordedDate` + `mirror.of`. // // `MIRROR_RECORDS` / `CREATOR_RECORDS` are the records as the matcher reads them // (lib/mirrors/match.ts MirrorRecord, recorded dates filled in); // `writeMirrorCorpus(channelsDir)` writes the same three channels to disk // (config.json, data//metadata.info.json, availability.json) for the // controller and the editor's e2e; `EXPECTED` is what a scan finds. import { mkdir, writeFile } from "node:fs/promises"; import path from "node:path"; export const MIRROR_SLUG = "synth-vod-archive"; export const CREATOR_SLUG = "synth-streamer"; export const RUMBLE_SLUG = "synth-streamer-rumble"; export const RECORDED_DATE_PATTERN = "(?\\d{1,2})/(?\\d{1,2})/(?\\d{4})"; const vod = (date, topic) => `[VOD] SynthStreamer - ${date} - ${topic}`; // [id, dir?, title, uploadDate, recordedDate?, duration, live, availability?] const MIRROR = [ ["vod-m1", null, vod("03/01/2023", "Big News Day, Kitchen Fire & More"), "20230304", "20230301", 10790, false], ["vod-m2", null, vod("03/05/2023", "Oven Lawsuit Explained And Toaster Recall"), "20230308", "20230305", 8950, false], ["vod-m3", null, vod("03/09/2023", "Spatula Drama Gets Worse"), "20230311", "20230309", 7180, false], ["vod-m4", null, vod("03/11/2023", "Garden Hose Investigation"), "20230314", "20230311", 5000, false], ["vod-m5", null, vod("03/12/2023", "Pan Review Marathon"), "20230316", "20230312", 14350, false], ["vod-m7", null, "[VOD] SynthStreamer - Bonus Stream", "20230320", undefined, 3600, false], ]; const CREATOR = [ ["yt-s1", null, "Big News Day, Kitchen Fire & More", "20230301", undefined, 10800, true, "public"], ["yt-s2", null, "Oven Lawsuit Explained And Toaster Recall", "20230306", undefined, 9000, true, "deleted"], ["yt-s3", null, "Spatula Drama Gets Worse", "20230309", undefined, 7200, true, "private"], ["yt-x1", null, "Old Pantry Tour", "20220110", undefined, 400, false, "deleted"], ["yt-x2", null, "Short Clip About Forks", "20230307", undefined, 300, false, "deleted"], ["yt-n1", null, "Weekly Mailbag", "20230312", undefined, 600, false, undefined], ]; const RUMBLE = [ ["v4embed1", "v1abc-big-news-day", "Big News Day, Kitchen Fire & More", "20230301", undefined, 10805, true, "public"], ["v4embed2", "v1abd-oven-lawsuit", "Oven Lawsuit Explained And Toaster Recall", "20230306", undefined, 9010, true, undefined], ["v4embed5", "v1abe-pan-review", "Pan Review Marathon", "20230313", undefined, 14400, true, "public"], ]; function record(row) { const [id, dir, title, uploadDate, recordedDate, duration, wasLive, availability] = row; const gone = availability === "deleted" || availability === "private" ? availability : null; return { id, ...(dir ? { dir } : {}), title, uploadDate, ...(recordedDate ? { recordedDate } : {}), duration, wasLive, gone, }; } export const MIRROR_RECORDS = MIRROR.map(record); export const CREATOR_RECORDS = CREATOR.map(record); export const RUMBLE_RECORDS = RUMBLE.map(record); export const CHANNELS = [ { slug: MIRROR_SLUG, platform: "odysee", rows: MIRROR, config: { handling: "transcribe", platform: "odysee", name: "Synth VOD Archive", url: "https://odysee.com/@SynthVodArchive:0", recordedDate: { titlePattern: RECORDED_DATE_PATTERN }, mirror: { of: [CREATOR_SLUG, RUMBLE_SLUG] }, }, page: (id) => `https://odysee.com/@SynthVodArchive:0/${id}:1`, }, { slug: CREATOR_SLUG, platform: "youtube", rows: CREATOR, config: { handling: "youtube", platform: "youtube", name: "SynthStreamer", url: "https://www.youtube.com/@SynthStreamer/videos" }, page: (id) => `https://www.youtube.com/watch?v=${id}`, }, { slug: RUMBLE_SLUG, platform: "rumble", rows: RUMBLE, config: { handling: "transcribe", platform: "rumble", name: "SynthStreamer (Rumble)", url: "https://rumble.com/c/SynthStreamer" }, page: (_id, dir) => `https://rumble.com/${dir}.html`, }, ]; // The three channels on disk under `channelsDir`. No index: a scan reads them // off disk (the controller's fallback for videos the index has not seen). export async function writeMirrorCorpus(channelsDir, opts = {}) { for (const ch of CHANNELS) { const dir = path.join(channelsDir, ch.slug); await mkdir(path.join(dir, "data"), { recursive: true }); const config = opts.noMirrorOf && ch.slug === MIRROR_SLUG ? { ...ch.config, mirror: undefined } : ch.config; await writeFile(path.join(dir, "config.json"), JSON.stringify(config, null, 2)); for (const [id, vdir, title, uploadDate, , duration, live, availability] of ch.rows) { const videoDir = path.join(dir, "data", vdir ?? id); await mkdir(videoDir, { recursive: true }); const webpageUrl = ch.page(id, vdir ?? id); await writeFile( path.join(videoDir, "metadata.info.json"), JSON.stringify({ id, title, upload_date: uploadDate, duration, webpage_url: webpageUrl, ...(ch.platform === "odysee" ? { webpage_url_basename: id, extractor_key: "LBRY" } : {}), ...(ch.platform === "rumble" ? { extractor_key: "Rumble" } : {}), ...(ch.platform === "youtube" ? { extractor_key: "Youtube" } : {}), live_status: live ? "was_live" : "not_live", }), ); if (availability) { await writeFile( path.join(videoDir, "availability.json"), JSON.stringify({ checkedAt: "2026-10-01T00:00:00.000Z", availability, webpageUrl }), ); } } } } // What a scan of the corpus finds (lib/mirrors/match.ts's rules). export const EXPECTED = { window: { from: "20230301", to: "20230320" }, status: { "vod-m1": "creator-public", "vod-m2": "creator-deleted", "vod-m3": "only-copy", "vod-m4": "only-copy", "vod-m5": "never-uploaded", "vod-m7": "only-copy", }, byStatus: { "only-copy": 3, "creator-deleted": 1, "never-uploaded": 1, "creator-public": 1 }, byPlatform: { rumble: { public: 3, gone: 0, none: 3 }, youtube: { public: 1, gone: 2, none: 3 }, }, // yt-s2 (vod-m2), yt-s3 (vod-m3) held; yt-x2 not; yt-x1 outside the window. creatorRemoved: { inWindow: 3, held: 2 }, held: { "yt-s2": ["vod-m2"], "yt-s3": ["vod-m3"], "yt-x2": [] }, };