The stream check refuses streams that parallel downloads could keep pace with #63
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
cmoriarty/sports-breaker#63
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
verify.verifytimes the download of one segment on one connection. It refuses the stream when that takes longer than the segment's duration, with the reason "segment slower than real time" (backend/app/verify.py). The rule predates #56. A channel now downloads three segments at once (CHANNEL_FETCH_CONCURRENCY, three by default), so a stream at 1.2× real time per connection keeps pace easily, with about 1.6 s of download per 4 s of video. That's the per-connection-limited CDN #56 was built for. The check now refuses streams the channel could play.Seen live
2026-10-31 14:24 UTC, Chelsea vs. Man Utd: the standby search refused topsurge.st with "segment slower than real time: 4.9s for a 4.0s segment". topsurge.st was the best stream of the game (1152×648 at 29.97 fps), and it had played on the same channel an hour earlier. On the card it was the "1 other" in "5 refused".
How often: this is the only refusal by this rule in the event log, which goes back to 2026-10-26: 229 checks, 458 refused links, one of them by speed. So it's rare, but when it fires it can refuse the best stream on offer.
The idea
Let the check accept a segment up to about twice real time when downloads run in parallel. The limit could follow the number of download slots with a margin, or simply be 2×. A segment slower than that still refuses.
What stays covered: a source that can't really keep up is still caught after it lands, for example one whose CDN answers parallel downloads with 429 and drops to one download at a time. The channel's own rules from #57 catch it: game skipped makes it Falling behind, and dry spells make it Stalling.
Optional: the check could download two segments at once, to catch a 429 before the stream is used rather than after.
Not part of this: the "no stream found" refusals. On this game givemestreams.cfd, buff-streams.buzz and resports.cfd refused that way on every check from noon on. That's a separate question: the hubs list hosts that don't carry the game, or a player our reader doesn't recognise.
Decided 2026-10-31 (operator): the check doesn't assume parallel downloads work, because some CDNs refuse them (givemestreams.cfd answered 429 on Lakers vs. Warriors). It tests them first.
The test: download the newest segments at once, as many as the channel downloads at once (
CHANNEL_FETCH_CONCURRENCY, three by default). The operator chose three over two so the test matches playback: a CDN that allows two but refuses three would otherwise pass the check and fail on landing.The extra cost is two more segments per full check; the 150 s re-checks don't change.
Refined in the design (
openspec/changes/parallel-pace-check): the parallel test runs only when it's needed.So there's no need to mark a stream one-at-a-time. A fast stream keeps pace even after a 429 sends it to one download at a time, and a slow stream only passes if three at once worked.
Closing: deployed 2026-10-31 17:44 UTC (PR #67, merged as
1938e97), with the design refined in the comment above.Tests:
How to tell live: a pass by the parallel test isn't logged; the link simply verifies. A refusal by this rule now reads "even 3 at once" or "refused 3 downloads at once" in a check's history. Reopen if a stream that passed this way can't keep pace once it plays.