Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 14b7b84f0b0d6443ec027e05d34250c86aaef2e8
parent 3cf6b2cbbe229d592d6bdfda497b2e8e3d794858
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sat, 21 Nov 2026 01:10:46 -0500

docs: record-live's retries, the live-edge fallback and the live recordings listing

OPERATING.md "Record a live stream" says the attempt schedule, what is not
retried, what a fallback loses, `get live-recordings` and `--wait-started`,
and where a failure is said until it is acknowledged. COMMANDS.md
regenerated; an editor CHANGELOG bullet.

Co-Authored-By: Claude <noreply@anthropic.com>

Diffstat:
MCOMMANDS.md | 20+++++++++++++++++++-
MOPERATING.md | 27+++++++++++++++++++++++++++
Meditor/CHANGELOG.md | 12++++++++++++
3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/COMMANDS.md b/COMMANDS.md @@ -147,7 +147,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | `remote-listing` | remote-listing lists an Odysee or BitChute channel upstream and diffs it against what it holds: {"slug"}. One flat-playlist read on the platform's queue (refused while it is held or cooling down; a 429 backs it off), nothing written. `get remote-listing <slug>` waits for the job and prints {listed, held, notHeld: \[{id, url}\], heldNotListed: \[id\], ...} on stdout. | | | `attach-media` | attach-media copies each held video's file out of a LOCAL archive into the saved-video store, as its source container (nothing fetched): {"slug", "source"} — an absolute path to a directory, a .zip (read in place) or a .7z. The id is the folder's trailing "(&lt;id&gt;)", else the file's yt-dlp suffix; "items": \[{"id", "path"}\] names exact files (path inside the source), "match" narrows the folders by regex. "createRecords": true writes a record for a video the channel does not hold; "replace": true re-attaches over a saved container. "fillDates": true gives a held record attach-media made (saved-video.json origin "local-archive") that has no upload\_date the date from its folder's description.txt, through the metadata history ("dated" in the log and summary); a record with a date, or one attach-media did not make, is never touched. "dryRun": true logs each folder's class (attach, not-held, already-attached, lost, no-media, unmatched, ambiguous, and dated) and the held videos with no media in it, and writes nothing. The log ends with a summary: line; a re-run resumes. | `pnpm ops attach-media --json '{"slug":"demo-yt","source":"/abs/YouTube.zip","match":"aaaaaaaaaaa\|bbbbbbbbbbb","fillDates":true,"dryRun":true}' --wait` | | `import-media` | import-media makes ONE file from outside the archive a normal transcribed item: {"slug", "path"} (absolute) and which record — "url" (the source page: one metadata-only pass makes or refreshes the record, under the id the archive keys it by — Rumble's URL id), "id" (a record already here) or "meta": {"title", "date"?, "duration"?, "description"?} (by hand). ffprobe must read it; an MPEG-TS, a .part or an FLV is remuxed -c copy to mp4 (+faststart), never re-encoded. It lands in the saved-video store only when longer than a container already there ("replace": true lands it anyway), then audio.&lt;fmt&gt;, the archive line and media-import.json. "move": true removes the original once the copy verifies; "audio": false lands the container only; "transcribe": true queues a transcribe-one job (held by any pause; without it the transcription lane takes it by its rules); "doNotClean": true marks it, with "note". "dryRun": true says what it would do and writes nothing. A directory, a .zip or a .7z goes to attach-media ("id", "replace", "dryRun" only). | `pnpm ops import-media --json '{"slug":"demo-rumble","path":"/abs/stream.mp4.part","url":"https://rumble.com/v1abcde-title.html","move":true}' --wait`<br>`pnpm ops import-media --json '{"slug":"demo-archive","path":"/abs/talk.mkv","meta":{"title":"A talk","date":"2019-05-01"},"dryRun":true}' --wait` | -| `record-live` | record-live records a live stream until it ends, then lands it as import-media lands a file: {"slug", "url"} (or "id" of a record here), "fromStart"? (true: yt-dlp --live-from-start — Rumble's DVR playlist holds a stream's first 4 hours), "maxHeight"? (720; null = the tallest), "separate"? (true: the video at maxHeight plus the best audio, merged — the default on YouTube, whose live streams from the start offer no single stream with both; false: one muxed stream — Rumble, Kick), "transcribe"?, "doNotClean"?, "note"?, "dryRun"?. On Rumble a refused yt-dlp falls back to the page's own playlist (a browser under xvfb, then ffmpeg). On Kick ("kick.com/&lt;channel&gt;" or its VOD) the ongoing VOD is polled from its first segment beside the channel's live stream. One job per stream; job cancel stops it with SIGINT and lands what it has (video and audio left unmerged are merged, -c copy); the longest part wins. Refused for a stream that is not live. "preclip": true (or {"everyMinutes", "maxChunkMinutes", "overlapSeconds", "scan", "mine", "project"}, over settings.livePreclip) starts live-preclip once the first part begins, and implies "transcribe". | `pnpm ops record-live --json '{"slug":"demo-rumble","url":"https://rumble.com/v1abcde-title.html"}'`<br>`pnpm ops record-live --json '{"slug":"demo-kick","url":"https://kick.com/somechannel"}'`<br>`pnpm ops record-live --json '{"slug":"demo-yt","url":"https://www.youtube.com/watch?v=<id>","preclip":{"everyMinutes":10}}'` | +| `record-live` | record-live records a live stream until it ends, then lands it as import-media lands a file: {"slug", "url"} (or "id" of a record here), "fromStart"? (true: yt-dlp --live-from-start — Rumble's DVR playlist holds a stream's first 4 hours), "maxHeight"? (720; null = the tallest), "separate"? (true: the video at maxHeight plus the best audio, merged — the default on YouTube, whose live streams from the start offer no single stream with both; false: one muxed stream — Rumble, Kick), "transcribe"?, "doNotClean"?, "note"?, "dryRun"?. On Rumble a refused yt-dlp falls back to the page's own playlist (a browser under xvfb, then ffmpeg). On Kick ("kick.com/&lt;channel&gt;" or its VOD) the ongoing VOD is polled from its first segment beside the channel's live stream. One job per stream; job cancel stops it with SIGINT and lands what it has (video and audio left unmerged are merged, -c copy); the longest part wins. Refused for a stream that is not live. "preclip": true (or {"everyMinutes", "maxChunkMinutes", "overlapSeconds", "scan", "mine", "project"}, over settings.livePreclip) starts live-preclip once the first part begins, and implies "transcribe". A from-start attempt that records nothing (yt-dlp: "The downloaded file is empty") is tried again at +60 and +180 s, then from the live edge at 0, +60 and +180 s (each wait jittered); a stream that has ended, an argv no try can fix and a Cancel are not retried. A live-edge fallback says what it lost (the first N min of the stream) and needs a person. The reply is {jobId, kind, "check"}: the `get live-recordings` command that answers for it. --wait-started returns once media bytes are being written (the recording's row on stdout, exit 0) or with the reason it failed (exit 1); 15 minutes by default, --wait-timeout overrides. | `pnpm ops record-live --json '{"slug":"demo-rumble","url":"https://rumble.com/v1abcde-title.html"}'`<br>`pnpm ops record-live --json '{"slug":"demo-kick","url":"https://kick.com/somechannel"}'`<br>`pnpm ops record-live --json '{"slug":"demo-yt","url":"https://www.youtube.com/watch?v=<id>","preclip":{"everyMinutes":10}}'`<br>`pnpm ops record-live --json '{"slug":"demo-yt","url":"https://www.youtube.com/watch?v=<id>","doNotClean":true}' --wait-started` | | `local-media-configure` | local-media-configure gives a video channel a LOCAL MEDIA LIBRARY: {"slug", "sourceId", "directory"} — a stable lowercase id and an absolute directory on the editor server whose recordings stay where they are (never copied, moved or deleted). Written through the channel config; a channel that already has one is refused, and so is queued or running channel work. Playback is not set. Synchronous. | `pnpm ops local-media-configure --json '{"slug":"demo-local","sourceId":"library-1","directory":"/mnt/recordings"}'` | | `local-media-preview` | local-media-preview scans the library and writes nothing: {"slug"} -&gt; {preview: {sourceToken, counts, candidates}}. Each .mp4 directly in the directory (not its subdirectories) with its same-named .info.json and .vtt (or .srt) is "new", "existing" (its record is held) or "issue" (with issues). The sourceToken and a candidate's fingerprint (or preparationFingerprint, when it has no .info.json) are what the other local-media actions take. An unreachable library is an error, never an empty preview. | `pnpm ops local-media-preview --json '{"slug":"demo-local"}'` | | `local-media-prepare` | local-media-prepare reviews details for a recording with no .info.json and writes nothing: {"slug", "sourceToken", "media", "sourceFingerprint" (the candidate's preparationFingerprint), "details": {"mode": "inspect" \| "manual", "title", "recordedDate"? (YYYY-MM-DD), "durationSeconds"? (manual)}} -&gt; {review: {metadata, fingerprint}}. "inspect" measures the duration with ffprobe. Import it with local-media-import, the review's fingerprint and "preparation": {"sourceFingerprint", "details"}. | `pnpm ops local-media-prepare --json '{"slug":"demo-local","sourceToken":"<token>","media":"talk.mp4","sourceFingerprint":"<fp>","details":{"mode":"inspect","title":"A talk"}}'` | @@ -155,6 +155,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | `local-media-link` | local-media-link links a record the channel already holds to its library original: {"slug", "sourceToken", "media", "fingerprint", "dryRun"?} for an "existing" candidate. Only when the library's .info.json and transcript match the record's byte for byte is external-media.json written ("attached"; "already-linked"; "conflict" keeps a different one). Nothing else changes, and no playback is granted. "dryRun" answers "ready" without writing. | `pnpm ops local-media-link --json '{"slug":"demo-local","sourceToken":"<token>","media":"talk.mp4","fingerprint":"<fp>","dryRun":true}'` | | `live-preclip` | live-preclip transcribes and mines a recording WHILE it records: {"slug", "id", "action"?: "start" (default) \| "stop" \| "status" \| "finalize"}, and for start "everyMinutes"? (10), "maxChunkMinutes"? (20), "overlapSeconds"? (15), "scan"? (true: the laugh scan), "mine"? (true), "project"? (the umtool project, &lt;id&gt;-live). One job per stream beside the recorder's: each tick reads only the new span of the growing file (never writing it), transcribes it on a worker lease (one at a time — a busy worker coalesces ticks), splices it into data/&lt;id&gt;/live-transcript.json (provisional) and grows the umtool project. Skipped and said: under 30 s new, MemAvailable under HEAVY\_MIN\_FREE\_MB (6000), the store's disk under 2 GB. When the stream lands: the clock check (flagged when the landed video's start differs), then the final transcript supersedes the live one. stop cancels the job, never the recording; status prints the state; finalize does the supersede by hand. No network request. | `pnpm ops live-preclip --json '{"slug":"demo-yt","id":"<videoId>","action":"status"}'` | | `live-clip` | live-clip makes a shareable clip of a stream still live: {"slug", "id", "start", "end"} (seconds of the stream, at most 2:20) or "clip" (a clip id of the project), "project"? (&lt;id&gt;-live), "replace"?. umtool cuts the window from the recording now (the editor's /api/media/live-window: the part being written, or the saved video once landed; no network), adds the clip, and makes its short with the live transcript's captions. With --wait the result (the short's URL) is stdout. | `pnpm ops live-clip --json '{"slug":"demo-yt","id":"<videoId>","start":3605,"end":3660}' --wait` | +| `live-recording-ack` | live-recording-ack {"slug", "id", "startedAt"?, "by"?} acknowledges every run of the record that needs a person (or the one run startedAt names): listed still, counted no more. /review's Acknowledge. | `pnpm ops live-recording-ack --json '{"slug":"demo-yt","id":"<videoId>"}'` | | `prepare-playable` | prepare-playable remuxes each of a channel's saved containers, losslessly (-c copy), into a browser-playable mp4 (+faststart) or webm, and makes one single-file torrent per copy, under playable/ beside the saved-video store: {"slug"}. "ids" narrows it; "trackers": \[...\] is each .torrent's announce list (none by default; the infohash does not depend on it); "root" names another playable root. A video prepared from the same source (by sha256) is skipped; "dryRun": true logs each decision. | | | `compact-saved-videos` | compact-saved-videos re-encodes saved videos to AV1 (SVT-AV1, settings savedVideoCompaction: crf 36, preset 8, a keyframe every 5 s, the source's height, Kick and Twitch above 30 fps to 30, every other stream and the chapters copied), verifies the copy and makes it the active one; the original stays beside it ("keptAs": "original"): {"items": \[{"slug", "id"}, ...\]} names videos (deliberately stored only: a pin, an explicit persist, a requested or landed container -- never keep-latest, never persist-kept's override); {"select": true, "slugs"?} asks the selector (and platform, height and video bitrate) and is a DRY RUN unless "dryRun": false. A named video the selector would not pick is refused unless "belowThreshold": true (the refusal says how little it saves). "dryRun": true answers each video's line -- size, bitrate, height, fps, the estimate (size, hours), the disk it needs, or why it is skipped. "crf", "preset", "maxFps", "chunkMinutes" override the settings for the run; "retryFailed": true encodes again one whose last checks failed; "reverify": true checks its KEPT encode again without encoding (a chunk whose own content failed is encoded again). One job per channel on the compact queue, one video at a time, each chunk through the heavy slot; a Retry resumes. The checks include a whole-file comparison and excerpts across every chunk join. dropOriginal is "keep" by default; under "after-verify" the original is dropped in a later step once the copy re-checks from disk -- never for a video not freshly checked on its platform (get compaction-review). There is no backup of the store: after a drop the compacted copy is the only copy. | | | `review-compacted-original` | review-compacted-original records a person's review of one compacted copy (watch it first: get compaction-review's "watch"): {"slug", "id", "note"?}. It names the copy it is for ("watched", its sha256) and counts for that copy only; it changes nothing on disk. It is what lets drop-saved-alternate ("confirmOriginal": true) drop the original of a video not freshly checked on its platform. "formerOriginal": "&lt;file&gt;" reviews the active copy that replaced a former original instead. | | @@ -276,6 +277,8 @@ Usage: pnpm ops <action> [--json '<body>' | --file <path>] [--wait] pnpm ops get transcript <videoId> [--slug <slug>] pnpm ops get coverage <slug> pnpm ops get generation-usage [<YYYY-MM-DD>] | iterations <article> + pnpm ops get live-recordings [<slug>[/<id>]] [--all] + pnpm ops record-live --json '<body>' --wait-started [--wait-timeout <seconds>] pnpm ops list --wait follows the job's log and survives a poll that fails (a busy @@ -463,6 +466,21 @@ get transcript <videoId> [--slug <slug>] reads one video's cues off disk the English VTT alone — {source, cuesJson, title?, ..., cues}. Nothing is written. Without --slug, the channel holding data/<id>/ is found. +get live-recordings [<slug>[/<id>]] [--all] is THE answer to "is this + stream being recorded, and is it growing" — never a job for the video + id (a live-chat job is one too). Per run, from its own record: status + (recording | interrupted: no job runs it | landed | failed | cancelled), + job, bytes, lastGrowthAt, stalled (not grown for + settings.liveRecording.stallMinutes, 10), streamElapsedSeconds, + capturedSeconds (once landed), attempts, fallback, lost, error, mustKeep, + needsAttention, reason, check. Default: what is recording, what needs a + person, the last 7 days; --all every run kept + (channels/<slug>/live-recordings.json, never pruned of a failure). + needsAttention (failed, interrupted, or the stream's start lost) stays + until live-recording-ack or a later recording that lands from the start; + /review, /jobs, the channel and video pages show the same rows, and + every ops reply then prints "! N live recordings need you" on stderr. + "preview": "<branch>" on deploy-site or build-deploy makes it a Cloudflare Pages PREVIEW instead of production: the same bundle goes to a branch alias, https://<branch>.<project>.pages.dev, and the live site is left diff --git a/OPERATING.md b/OPERATING.md @@ -1102,6 +1102,9 @@ pnpm ops diarize --json '{"slug":"example"}' --wait # one channe pnpm ops record-live --json '{"slug":"example-rumble","url":"https://rumble.com/v1abcde-a-live-show.html"}' pnpm ops record-live --json '{"slug":"example-kick","url":"https://kick.com/somechannel","doNotClean":true,"note":"keep"}' pnpm ops record-live --json '{"slug":"example-youtube","url":"https://www.youtube.com/watch?v=abcdefghijk","fromStart":true}' +pnpm ops record-live --json '{"slug":"example-youtube","url":"https://www.youtube.com/watch?v=abcdefghijk","doNotClean":true,"note":"keep"}' --wait-started +pnpm ops get live-recordings example-youtube/abcdefghijk +pnpm ops live-recording-ack --json '{"slug":"example-youtube","id":"abcdefghijk"}' pnpm ops import-media --json '{"slug":"example-rumble","path":"/home/me/Podcasts/v1embed.from-start.mp4.part","url":"https://rumble.com/v1abcde-a-live-show.html","move":true,"dryRun":true}' --wait pnpm ops import-media --json '{"slug":"example-archive","path":"/mnt/old/talk.mkv","meta":{"title":"A talk","date":"2019-05-01"}}' --wait pnpm ops keep-videos --json '{"slug":"example-rumble","ids":["v1abcde"],"note":"keep"}' @@ -1120,6 +1123,30 @@ pnpm ops keep-videos --json '{"slug":"example-rumble","ids":["v1abcde"],"note": and lands what they have: video and audio left unmerged by a cancel or a crash are merged then (`-c copy`), and an earlier run's unmerged pair is merged and landed by the next run. A stream that is not live is refused: download it, or import a recording of it. +- **A from-start attempt that records nothing is tried again, then the live edge** (20 Nov 2026: yt-dlp + `--live-from-start` said "The downloaded file is empty" after 55 s, and nothing retried). The schedule: from its + start at 0, +60 and +180 s, then from the live edge (`--no-live-from-start`, the request Kick's channel recorder + already makes) at 0, +60 and +180 s — at most six recorder spawns in about eight minutes, each wait stretched by + `pacing.jitter`, a Cancel ending any wait. Not retried: a stream that has ended or gone private, an argv no try + can fix ("Requested format is not available"), a Cancel, a part that recorded bytes. A recording that falls back + to the live edge says in the log and the record what it lost ("the first 2 h 14 min are NOT recorded"); that is a + failure needing a person even while the live edge records. +- **Is it recording, and is it growing? `pnpm ops get live-recordings [<slug>[/<id>]] [--all]`** — never "is there + a job for this video id" (a live-chat capture is one too). Each run from its own record: `status` (`recording`, + `interrupted` when no record-live job runs it, `landed`, `failed`, `cancelled`), the job, `bytes` and + `lastGrowthAt` of its staging files, `stalled` (not grown for `settings.liveRecording.stallMinutes`, 10), + `streamElapsedSeconds`, `capturedSeconds` once landed, `attempts`, `fallback`/`lost`, `error` (yt-dlp's own + `ERROR:` line, and the attempts), `needsAttention`, `reason`, `check`. record-live's reply carries that `check` + command beside the job id; `--wait-started` returns only once media bytes are growing (the row on stdout, exit + 0) or with the reason it failed (exit 1), within 15 minutes unless `--wait-timeout` says otherwise. +- **A failure is loud until a person says otherwise.** Every run has a row in `channels/<slug>/live-recordings.json`, + written on every save of its record and never removed for failing — also when the run removes the empty + `data/<id>/` it made, and also for a refusal before any recorder started. A row needs a person when it failed, + was interrupted, or lost the stream's start; it is shown on /review ("Live recordings that need you", with + **Record again** and **Acknowledge**), as a banner on /jobs and the channel and video pages, and as + `! N live recordings need you` on stderr after every `pnpm ops` reply (the `x-archilyzer-attention` header). It + stops counting at `live-recording-ack` (or Acknowledge), or when a later recording of the same id lands from its + start. No desktop notification: the editor has no such path. - `import-media` (Media → **Import a file**) makes one file from outside the archive a normal transcribed item: `"url"` makes or refreshes the record from its page (metadata only, under the id the archive keys it by — a Rumble URL's id, not the embed id in the file name), `"id"` names a record already here, `"meta"` describes one diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog ## [Unreleased] +- **A live recording that fails is retried, then recorded from the live edge, and its failure stays loud.** + - A from-start attempt that records nothing ("The downloaded file is empty") is tried again at +60 and +180 s, then + from the live edge at 0, +60 and +180 s. A fallback to the live edge says how much of the stream's start it lost. + - `pnpm ops get live-recordings` answers whether a stream is being recorded and growing, from the recording's own + record: status, bytes, last growth, stalled, attempts, what was lost. `record-live` answers with the command that + checks it, and `--wait-started` returns once media is being written. + - A failed, interrupted or start-losing recording is listed on /review with Record again and Acknowledge, shown as a + banner on /jobs and the channel and video pages, and said on stderr after every `pnpm ops` reply, until it is + acknowledged (`pnpm ops live-recording-ack`) or a later recording of it lands. Its row in + `channels/<slug>/live-recordings.json` is never removed for failing. + - New setting `liveRecording.stallMinutes` (default 10). + - The recorder's job log no longer takes every progress line of a separate-streams recording (~1 MB a minute). - **umtool: the gap mark's border is the deck's accent colour.** - The operator picked variant B. The border is drawn in the deck's accent, the colour of the deck's accent rule and the dots in its source line, at full opacity. The box behind the text is near-black at 90 %, and the text