commit a146d4bb488252c8f85afee1bec070291278bb20
parent 3bab265f906eb1e28f44905ca83e0814dea9423f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 21 Oct 2026 13:49:07 -0400
export: a ?t= link to a removed YouTube video opens the transcript at t
The transcript's position on a YouTube video came only from the player's
progress events, so a video YouTube no longer plays (no ready, no progress,
or a dead player's 0) opened at the start whatever the link said. Every
platform now seeds the position from ?t= when the record loads; YouTube's
progress is ignored until the ?t= seek lands and after the embed errors.
The new modal-open spec blocks the embed on a YouTube record and fails on
the old code.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/common/components/PlayerProvider.tsx b/common/components/PlayerProvider.tsx
@@ -424,6 +424,10 @@ export function PlayerProvider({
const playerRef = useRef<PlayerHandle | null>(null);
const pendingSeekRef = useRef<number | null>(null);
const readyForSlugRef = useRef<string | null>(null);
+ // The YouTube embed said it cannot play this video (removed, private,
+ // embedding off). Its progress events are then the dead player's 0, never
+ // the transcript's position: they are ignored until the video changes.
+ const youtubeFailedRef = useRef(false);
// Tracks the slug we've already kicked off a chat fetch for. Decoupled
// from `chat.slug`/`chat.status` so we don't include them in the
// chat-fetch effect's deps (which would cause a cleanup-during-fetch race).
@@ -692,6 +696,7 @@ export function PlayerProvider({
digestInFlightForRef.current = null;
setKickError(false);
setFileError(false);
+ youtubeFailedRef.current = false;
if (!urlSlug) return;
// Posts are not transcripts — never run the video fetch for one.
// A post slug always arrives together with a slug change, so this closure's
@@ -893,19 +898,22 @@ export function PlayerProvider({
setCurrentTime(urlTime);
}, [urlSlug, urlTime]);
- // Rumble / Odysee / Twitch have no onReady or progress events; seed
- // currentTime from the URL so clip-mark buttons and active-cue highlighting
- // have a baseline, and mark the slug ready so later ?t= changes can seek via
- // the imperative handle.
+ // Every platform's transcript starts at ?t= the moment the video loads, so
+ // a link to a moment lands on its cue even when the player never gets there
+ // (a removed YouTube video: no ready, no progress, or a dead player's 0).
+ // A working player then takes over through its own progress events.
+ // Rumble / Odysee / Twitch have no onReady or progress events at all: mark
+ // the slug ready so later ?t= changes can seek via the imperative handle.
useEffect(() => {
+ if (!detail) return;
+ setCurrentTime(urlTime ?? 0);
if (
- detail?.platform === "rumble" ||
- detail?.platform === "odysee" ||
- detail?.platform === "twitch"
+ detail.platform === "rumble" ||
+ detail.platform === "odysee" ||
+ detail.platform === "twitch"
) {
readyForSlugRef.current = detail.slug;
pendingSeekRef.current = null;
- setCurrentTime(urlTime ?? 0);
}
// urlTime intentionally omitted — the urlTime effect above handles later changes.
// eslint-disable-next-line react-hooks/exhaustive-deps
@@ -1118,9 +1126,17 @@ export function PlayerProvider({
onReady={handleReady}
onPlay={() => setPlaying(true)}
onPause={() => setPlaying(false)}
- onProgress={(s: { playedSeconds: number }) =>
- setCurrentTime(s.playedSeconds)
- }
+ onError={() => {
+ youtubeFailedRef.current = true;
+ // Later ?t= changes still move the transcript (the urlTime effect).
+ readyForSlugRef.current = activeSlug;
+ pendingSeekRef.current = null;
+ }}
+ onProgress={(s: { playedSeconds: number }) => {
+ // Before the ?t= seek lands, a progress event is the load's 0.
+ if (pendingSeekRef.current !== null || youtubeFailedRef.current) return;
+ setCurrentTime(s.playedSeconds);
+ }}
/>
) : (
// Unknown/unsupported platform: degrade to a link rather than
diff --git a/export/CHANGELOG.md b/export/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **A link to a moment of a removed YouTube video opens the transcript at that moment.** `?v=…&t=<seconds>` for a video YouTube no longer plays used to open its transcript at the start: the reader followed only the player, which never got there. The transcript now starts at the linked moment on every platform, and a player that cannot play leaves it there. Needs a rebuild and deploy of each site.
- **A report can keep a timeline, and a reader can subscribe to it.** `report.json` `entries` (each `{ "id", "date", "title", "body" }`, optionally `updated`) shows as **Timeline** after In brief: dated entries, newest first, each date linking to the entry's own place on the page (`#<id>`), each body citing as a section's does. The report counts as updated at its newest entry, in its header and the report list. Each entry is a slide too, and the HTML, PDF and Markdown downloads carry the Timeline. On a site with a public URL, the report publishes its timeline as feeds — `feed.xml` (RSS) and `feed.json` (JSON Feed) beside its page — and its header reads **Subscribe: RSS · JSON**; a feed reader finds them from the page too. A site with no public URL publishes no feed. The MCP's `get_report` reads the timeline, and its `section` may name an entry. Needs a rebuild and deploy of each site with reports.
- **A report reads as an article, as slides, or in an overview of both.** Under a report page's header, a switch, **Article · Slides · Overview**, sticks just below the site's header as the article scrolls, on a phone too. **Slides** shows the report one 16:9 slide at a time, fitted to the screen in the site's accent and light or dark: a title slide, In brief, What the check found, one slide per section and per claim — its verdict, its finding and the evidence it rests on (a clip's still, a post's screenshot, the article's sentence, with its quote) — and a sources slide. ← → (and Page Up, Page Down, Home, End) or a swipe step through them; a citation's number opens its card; every slide has **Read this in the article**, and Esc goes back to the article where the slide stands. On a phone a slide reads top to bottom, its evidence under its words. **Overview** lays the article's parts and their slides side by side on one tilted plane, each part beside its slide: ↑ ↓ walk them, a part opens the article there and a slide opens the slides there; with reduced motion, on a narrow screen, arriving by keyboard or with **Flat**, the same pairs lie flat. Switching keeps your place: the part being read opens its slide, and coming back from a slide lands that part just below the switch, uncovered. The view and the place are in the address (`?rv=slides#s-4`, `?rv=iso#<part>`), so a shared link opens the same slide; the article itself is unchanged for search engines and readers without script. A report's author can shape its slides in `report.json` (`slides`, and a section's or claim's `slide`: its own title, up to five short points, which evidence to show, a layout, or hidden); a report without them still has slides, made from its text. Needs a rebuild and deploy of each site with reports.
- **A report can be saved as slides.** The download line adds **Slides** (`slides.html`, one file that opens with no network: the slides with their pictures inside, the arrow keys stepping through them, each citation numbered to a reference list) and **Slides PDF** (one page per slide), and the evidence pack carries the slides too. Needs `reports export` (or prepare) and a rebuild and deploy of each site with reports.
diff --git a/export/e2e/modal-open.spec.ts b/export/e2e/modal-open.spec.ts
@@ -3,6 +3,7 @@ import {
CHANNEL_SLUG,
VIDEO_CHAT_SMALL,
VIDEO_TRANSCRIPT_ONLY,
+ transcriptPage,
} from "./fixtures/data";
import { expectModalOpen, installRoutes, urlParams } from "./helpers";
@@ -64,4 +65,24 @@ test.describe("video modal — open + mode inheritance", () => {
const beta = page.locator("li", { hasText: "beta line" });
await expect(beta).toHaveClass(/bg-blue-950/);
});
+
+ test("a YouTube video whose player never loads still opens at ?t=", async ({
+ page,
+ }) => {
+ // A removed YouTube video: the embed never gets ready or reports
+ // progress, so only the URL can put the transcript at the linked moment.
+ // (The fixture records are Rumble, whose time is seeded from the URL
+ // anyway; this one is YouTube, the platform that relied on the player.)
+ await page.route(/youtube\.com|youtube-nocookie\.com|ytimg\.com/, (route) => route.abort());
+ await page.route(/\/transcripts\/[^/]+\/page-\d+\.json$/, async (route) => {
+ const records = transcriptPage().map((r) => ({ ...r, platform: "youtube" }));
+ await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(records) });
+ });
+ await page.goto(`/?v=${CHANNEL_SLUG}/${VIDEO_TRANSCRIPT_ONLY}&t=101`);
+ await expectModalOpen(page);
+
+ const gamma = page.locator("li", { hasText: "gamma line" });
+ await expect(gamma).toHaveClass(/bg-blue-950/);
+ await expect(gamma).toBeInViewport();
+ });
});