We built a pipeline that makes a market show twice a day. The first episode aired on schedule.
Yesterday our news app published a morning briefing and an evening briefing, like it does every day. Today it added a second show on top of that: StarBrook Business, twice a day. A midday market report at 11:30 AM Centra
Yesterday our news app published a morning briefing and an evening briefing, like it does every day. Today it added a second show on top of that: StarBrook Business, twice a day. A midday market report at 11:30 AM Central, and a market-close wrap at 3:00 PM Central. Ninety seconds each, vertical, same voice and same look as the briefings.
The first live episode went out today, Tuesday, November 24, on schedule. It was built by a pipeline, not by a person sitting down to edit: scheduled execution, story selection, market data, narration, validation, assembly, storage, publication, distribution. Nobody touched it between the cron firing and the video landing in the app.
That's the story. The pipeline worked. Everything else in this post is the detail of how — and the one place it didn't, at first: YouTube. Both episodes are on YouTube now; they just got there hours late, after the upload cap cleared.
The pipeline
One cron per slot, Monday to Friday, America/Chicago time: 11:30 for midday, 15:00 for close. A single run does the whole job — build, upload, manifest, YouTube — so there is no second upload job to double-post.
1. Scheduled execution. The cron fires the builder in live mode. Nothing else triggers it.
2. Business news selection. The builder pulls from the day's edition: the Business section first (CNBC and Fortune — the only two business sources whose full text actually opens inside the app), then markets-keyword stories, then the previous evening's Business section, then live CNBC/Fortune RSS as a last resort. Target is four stories, minimum three. The morning pool is thin — today's midday episode had to reach outside the Business section for its fourth story, a markets piece from the Top Stories section, labelled by its real section on screen. Every story needs a visual, and there's a fallback chain for that: photo first, then a video clip, then a different provider. A story with no visual anywhere gets skipped and the next pool story fills the slot. We never ship a text-only slide.
3. Market data retrieval. The indices come from our own quotes endpoint, which cross-checks Yahoo against FRED — more on that below. The movers come from a fixed watchlist of eight liquid symbols (Nvidia, Apple, Microsoft, Amazon, JPMorgan, Tesla, Alphabet, Meta), not a screener: the screener's raw results are penny stocks and warrants, and nobody wants those narrated as the day's movers. If the endpoint fails, the builder falls back to direct Yahoo calls, then to the edition's own markets line, and only as a last resort to 0.0% with a loud log line. If no index survives at all, the builder refuses to build rather than make a video with no markets line.
4. Narration generation. Stories are narrated from the edition headline and excerpt only — 34 words, two sentences max per story. Nothing is invented. The voice is the same one that reads the daily briefings. The intro and outro are templates, and the markets and movers lines are assembled from the data, biggest mover first.
5. Caption and completeness validation. Three layers, and this is the part we're proudest of. First, a narration gate runs before any audio is generated: every excerpt-derived line is checked for completeness, and a sentence cut off mid-thought is replaced with a verified source sentence or dropped — it falls back to the headline before it ever lets a half-sentence through. Second, a duration fit runs before text-to-speech: the script is estimated at 0.385 seconds per word, and trimmed in a fixed order — second excerpt sentences first, then also-watched names, then the second mover, then the last story — never the headline, never the markets line. If it still can't land in the 85–95 second band honestly, the build fails loudly instead of shipping a short video. Third, a verify step checks the finished file with ffprobe and frame checks, and deletes the output on any failure. Captions are written as VTT and SRT from the same script.
6. Video assembly. ffmpeg, 1080×1920 vertical, the same branding sting and slide system as the daily briefings, with a markets slide and a top-movers slide.
7. Storage and manifest publication. The video goes to our storage bucket under a business folder, dated object plus a latest alias, and a manifest entry is published with explicit file and poster paths — explicit because without them the app would derive the morning briefing's filename and play the wrong video. The app reads the manifest, so the episode appears in the app with no app or website code change. Business entries live in their own two-slot carve-out, so they never push briefings out faster.
8. External distribution. A YouTube post step uploads the same file to the StarBrook Business playlist. It's idempotent: a state file records each posted episode by key, so a retry after a failure uploads only if it never went up — it can never double-post.
The data, honestly
The midday numbers are delayed intraday prices, and the video says so — in the narration and on screen: "Delayed intraday · as of 11:33 AM CT." We never call them real-time.
The close numbers go through a cross-check, and it's worth saying precisely what that is, because it's easy to overstate. For each index, we compare Yahoo's previous close against the Federal Reserve's FRED observation for that same date — same date, never FRED's latest. If they agree within 0.1%, the close is published with both sources behind it. If they disagree, the index is omitted entirely — never published from either side. If FRED has nothing to compare (its Nasdaq series lags a day, so Nasdaq is routinely Yahoo-only), the number goes out flagged as unchecked.
What FRED does is corroborate the previous session's close, or veto it. It does not validate live prices, it does not validate the movers, and it has nothing to say about the midday video's numbers — those are Yahoo delayed quotes, full stop. And here is the correction the close episode forced: the video's close slide shows today's session values, labelled "today's close" — S&P 7,201, Dow 50,020, Nasdaq 23,734 at build time, Yahoo delayed prices. The cross-check validates the previous close those percent changes are measured against (S&P and Dow agreed Yahoo=FRED to the cent; Nasdaq was Yahoo-only, and the slide carries no per-index flag). So the honest claim is narrower than "two sources agree on the market": two sources agree on yesterday's close, which is the baseline; today's numbers on screen are Yahoo's.
The first episode
The midday episode is 86.66 seconds, eight caption cues, all complete sentences. Four stories: Best Buy's comparable sales up 6.1%, the highest in five years; Insmed shares up 14% on Sanofi's buyout; Russia accusing NATO member Estonia of hostile actions; and the markets piece about tech stocks partly reversing the Nvidia-sparked rally. Markets, delayed as of 11:33 AM CT: S&P 500 7,211, down 0.4%; Dow 50,012, up 0.8%; Nasdaq 23,769, down 1.3%. Top movers from the watchlist: Nvidia down 6.9%, Microsoft up 1.6%, then Apple up 1.2%, Alphabet down 1.1%, Meta down 0.6%.
The rehearsal the day before proved the build only — dry-run mode deliberately skips the upload, the manifest, and YouTube. Today was the first time the whole thing ran live, end to end, and it worked: the episode was in the app minutes after the cron fired.
The close episode ran at 3:00 PM and verified the same way. It is 89.2 seconds, eight caption cues, all complete sentences, and it opens "Good afternoon" — the greeting fix landed in time. Four stories, all CNBC: Best Buy's comparable sales up 6.1%, Insmed up 14% on Sanofi's buyout, Russia accusing Estonia, Anthropic down 8% below its $83 IPO price. Markets, labelled "today's close": S&P 500 7,201, down 0.5%; Dow 50,020, up 0.9%; Nasdaq 23,734, down 1.5%. Top movers: Nvidia down 5.9%, Apple up 1.4%, then Meta, Amazon, and Alphabet. It is live in the app. The YouTube upload failed twice on the same daily cap that took the midday episode, at 3:03 and 3:07 PM — but the cap cleared that evening and the retry posted it, YouTube-only, no rebuild: https://www.youtube.com/watch?v=5EZ5dZSd5qI.
The app is the product. YouTube is a channel.
That distinction matters, because the one thing that didn't work today was YouTube. The upload failed twice, at 11:33 and 11:37 AM, with uploadLimitExceeded. That error is a per-channel limit on how many videos YouTube lets a channel upload in a rolling 24 hours — YouTube publishes no number, and the channel's own history suggests planning on about ten a day. The cap had already tripped at 5:44 that morning, so the morning briefing and the weather video failed too. The video was already live in the app, so the failure lost nothing: the bucket and the manifest were good, and a re-run retries YouTube only, never rebuilds from scratch. That is exactly what happened: once the window cleared that evening, both episodes were retried YouTube-only and posted — midday https://www.youtube.com/watch?v=uwXqCj2stC4 and close https://www.youtube.com/watch?v=5EZ5dZSd5qI — same files, same hashes, same manifest. The app never noticed the delay. That's the operational lesson. Five scheduled videos a day plus uncapped breaking flashes is more than the channel can reliably post, and the retry loop made it worse — it re-attempted the capped video every five minutes with no backoff, seventy-one futile attempts across three days. The fix is to stop retrying a cap error, and to ration uploads under a daily budget with the briefings first. It is not the headline. The headline is that the system made the show on time.
Two things we found while verifying this post, because they show the work honestly. The close episode's intro said "Good evening" for a 3:00 PM slot — afternoon, not evening. That's fixed now; the close says "Good afternoon." And our own monitor judged every video against the wrong duration band unless the filename ended in -evening, so the 87-second midday video was flagged as out of band against the 55–65 second daily band. The video was fine; the monitor needed a business branch. That's fixed now too — business videos get the 85–95 second band, with regression tests covering all five video types, and the fix proved itself against the live manifest the same afternoon.
The close episode ran at 3:00 PM and was verified the same way — manifest, file, captions, numbers — before this article goes anywhere. A pipeline that makes the show is only as good as its next run.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.