Content extraction
The pipeline’s first stage, extract, gives every new item the text the later stages read: the article behind a teaser, or a video’s transcript (SI-535). Code: services/item-text.ts, pipeline/stages/extract.ts, feeds/transcript.ts, feeds/robots.ts.
It is free: it fetches pages and transcripts, but calls no model. It runs once per item for everyone who follows the source (scope item), and each user can turn it off in Settings → Executions (pipeline.md).
What an item gets
| Item | Text | text_source |
|---|---|---|
| Article already loaded (“always” source, or Load full article) | The loaded article | article |
| Feed text of 3,000 characters or more | The feed’s text, no fetch | feed |
| A teaser with a link | The article from the page (SI-568’s Readability extractor). It also replaces the item’s content, so the reader shows the whole article | article |
| A page with no more text than the feed | The feed’s text, not a failure | feed |
| A page that fails (paywall, login, 403, robots.txt) | The feed’s text | feed, with extraction_error |
| A video with captions | The transcript | transcript |
| A video without captions, or when YouTube refuses | The description | description, with extraction_error |
Each item stores text (clean plain text), text_source, word_count and text_extracted_at. text is pruned with the content after 90 days (retention). The word count stays.
A failure never fails the step: the item goes on with the text it has, and later stages run. The step’s note in Executions says what was found: “Article · 1,234 words”, “Transcript (automatic captions) · 5,432 words”, or “Feed text · 80 words · No article found on the page…”.
Pages
- robots.txt. The stage fetches pages on its own, so it asks the site’s
robots.txtfirst: rules forHotaru, else for*, longest match wins (RFC 9309). A site without one (4xx) allows everything. One whose server fails to send it (5xx, or no answer) allows nothing for an hour. Each site’s rules are kept for a day, and units of a batch on one site share one fetch. Load full article in the reader doesn’t ask: a person pressed it, like a browser. - The reader wins. When a reader loads the article while the stage waits for the page, the stage keeps the reader’s article. An article loaded with Load full article becomes the item’s text too.
- Politeness. At most 4 pages at once, 2 per site, a quarter second apart.
- Paywalls and logins. Readability finds no article, or less text than the feed has: the item keeps the feed’s text.
Transcripts
YouTube’s player API (InnerTube), asked the way the Android app asks, lists a video’s caption tracks. The watch page lists them too, but their links answer a server with nothing. Neither costs API quota, and no key is needed.
The stage picks the track that says best what is spoken: the uploader’s captions in the spoken language, else YouTube’s automatic ones in it, else any of the uploader’s (which may be a translation). YouTube dubs many videos into other languages and then lists automatic captions in every dub’s language, Arabic first. So the spoken language comes from the original audio track (audioTracks[defaultAudioTrackIndex], an id like en-US.4; dubs end in .10). A video that isn’t dubbed has one automatic track, which is in the spoken language. When YouTube says neither (no automatic track, or several), the title’s script names the language when it can: Hangul for Korean, Kana for Japanese, Han for Chinese, and Greek, Hebrew and Thai. Channels that add fan subtitles in many languages list them alphabetically, so without this a Korean video was read from its Arabic subtitles. The lines are joined into one paragraph, at most 300,000 characters. A slow answer (20 seconds) counts as a failure, and caption links are only fetched from youtube.com.
YouTube may change or block this at any time, and it blocks datacenter addresses more often than home ones. When it does, videos keep their description and the failure shows under Extraction failures. When YouTube asks the server to sign in, the failure says so, and YOUTUBE_PROXY_URL sends the requests through a proxy, such as one that leaves from a home connection (youtube.md). YOUTUBE_PLAYER_URL replaces the player API’s address. The e2e tests point it at nothing.
Reading time
Cards show “5 min read” (230 words a minute) once an item has a word count, and videos keep their duration. The stream API returns wordCount.
Failures by source
Settings → Executions → Extraction failures lists the user’s sources whose pages or transcripts failed in the last 30 days: how many of their items failed, and the last reason. The 10 that fail most show first; Show all lists the rest. GET /api/v1/pipeline returns the same as extractionFailures. The reader shows an article’s failure under its excerpt, with Try again. A video’s transcript failure shows only in Executions.
Measured
On the 100 real items of SI-514 (60 articles, 40 videos), from a home connection on 2026-11-14:
- Articles: 52 of 60 have their full text: 15 from the page, 37 already in the feed. 8 failed: HTTP 403 (3), paywall (2), robots.txt (1), HTTP 429 (1), unreachable (1).
- Videos: 35 of 40 have a transcript, median 990 words. 5 have no captions.