Repository navigation
fix: keep extracts inside their time budget; flag YouTube IP blocks - #6
Merged
Merged
Conversation
- Fetch the YouTube title via oEmbed, concurrently with captions, instead of a sequential watch-page scrape (up to 10s) before the caption request. Duration now comes from the guardrails' last-cue estimate. - Carry a monotonic deadline from the API/bot into the fetch: every YouTube request is capped at the time left, IP-block retries never sleep past it, and Vimeo requests are bounded too. Timed-out extracts stop calling upstream instead of running on in the worker thread. - New UPSTREAM_BLOCKED error code (503) for IpBlocked/RequestBlocked so the metrics dashboard separates proxy failures from videos without captions; YouTube timeouts map to UPSTREAM_TIMEOUT (504), network errors to a clear message instead of a 500. - CI: lint, type-check, and build the web app. - Web: remove seven unused components from an earlier homepage and fix the remaining lint errors (useHydrated replaces setState-in-effect guards). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Sep 28, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #5. Merge that first; GitHub will then retarget this PR to
main.Summary
Extract reliability
&and similar characters correctly, where the old regex left them HTML-escaped. Duration comes from the existing last-cue estimate inextract_guardrails.asyncio.wait_forcan't stop the worker thread, so a timed-out extract used to keep calling YouTube (and spending proxy bandwidth). The API and bot now pass atime.monotonic()deadline:requests.Sessionsubclass caps each YouTube request at the time remaining,UPSTREAM_BLOCKED(503) forIpBlocked/RequestBlocked, so the metrics dashboard (which groups byerror_code) separates proxy failures from videos that have no captions. Timeouts returnUPSTREAM_TIMEOUT(504). Network errors get a clear message instead of a 500.Housekeeping
web/.Generator,Hero,BentoGrid,layout/Navbar,layout/Footer,ui/Button,types/index.ts). No page imports them.useHydratedhook (useSyncExternalStore) replaces the setState-in-effect "mounted" guards inNavbarandThemeToggle.Test plan
python -m unittest discover -s tests: 67 pass (11 new). Covers concurrent title fetch, a slow title not holding captions, deadline session behaviour, no retry sleep past the deadline, the 503/504 mapping, and the Vimeo deadline.eslint .: 0 errors (1 existing font warning).tsc --noEmitpasses.UPSTREAM_TIMEOUTafter 0.09s without sending any request.next build: verified by the new CI job. It can't run locally untilnpm installrestores the Windowslightningcssbinary.