Repository navigation
Cut adverts a host inserts as it serves, whatever their language - #19
Merged
Merged
Conversation
Hosts such as Simplecast and Acast stitch adverts in per request, chosen by the listener's country, so a French show fetched from the UK carries English adverts. Language and proxies cannot remove them; a proxy only changes which adverts arrive. What every inserted advert has is that the host concatenates a file it already has: the same advert is the same MP3 frames in every episode, while the programme, encoded once per episode, never is. - src/lib/copied-audio.js finds stretches byte-identical across episodes, and the breaks between the slot markers Acast stitches around them, so adverts never heard elsewhere are cut too. New catalogue kind `inserted` (migration 014), one row per stretch or per break slot. - MP3 frame hashes are kept beside each fingerprint; older episodes are read once without decoding. - A feed whose host is seen inserting gets every new episode downloaded a second time a day later (same address and user agent), with a switch on the subscription form. - Guards: over 2.5 minutes, or a copy two episodes share mid-file, is offered not cut; breaks never exceed half an episode; an approved cut is never taken away for a row still waiting. Also fixes the jingle anchor cutting a show's spoken intro (present in 1.10.1): on Le Rendez-vous Tech it auto-confirmed the show's own theme and cut up to 1:33. A jingle starting more than 3 s after the host's inserted audio ends is no longer auto-confirmed, and an earlier auto-confirmation is taken back; owner-confirmed jingles are untouched. Measured on real feeds on 2026-10-28: RMC opener and closer in 30/30 episodes; Rendez-vous Tech pre-, mid- and post-rolls in 5/5 marked episodes, intro kept; RTL nothing. npm test 1476/1476, acceptance 65/65. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Hosts such as Simplecast and Acast insert adverts into the MP3 per request, picked by the listener's country. A French show fetched from the UK carries English adverts; from Germany, German ones. The goal is no inserted advert at all, so detection cannot rely on language, and a proxy only changes which adverts arrive.
The evidence used instead: a host splices in a file it already has, so the same advert is byte-for-byte the same MP3 frames in every episode, while the programme (theme included) is encoded afresh each time.
What changes
src/lib/copied-audio.js): stretches identical across two or more episodes are cut. New catalogue kindinserted, migration 014.scripts/check-copied-audio.mjs <folder>runs the search over downloaded episodes. Spec §19.3 and §19.7 and the README are updated.Measured on real feeds (2026-10-28, from the UK)
Neither Simplecast nor Acast leaves stitch marks, so the old second-download check never ran for these shows.
Testing
npm test: 1476/1476 (was 1428). Each new rule has a test, and each test was checked to fail with its rule removed.test/acceptance/run.shagainst a locally built image: 65/65, including a new step 24.Test fixtures that model a repeated theme or read now use a
variantheader option (test/helpers/mp3.js): same sound, different bytes, as a real re-encode is. Otherwise every synthetic repeat would count as inserted.Known gaps
🤖 Generated with Claude Code