filter ads from podcasts
README.md

Podstuff #

Podstuff is a self-hosted podcast proxy. It detects sponsor reads and ad breaks ahead of time, then generates edited MP3s on demand for your existing podcast app.

Run locally #

Install Bun 1.4.4 or later and FFmpeg with the libmp3lame encoder. For local Granite transcription, install uv on the server. uv provides the Python runtime and bindings on first use.

bun install --frozen-lockfile
bun run dev

Open http://127.0.0.1:3000. For production, run bun run build followed by bun run start. Both start commands run the dashboard and background worker.

Configure models #

In Models, choose a provider and model independently for each step.

Step Options
Transcription OpenRouter Whisper, Groq Whisper, OpenAI Whisper, local Granite Speech, or a custom timestamped transcription endpoint
Ad detection Pi's chat model catalog, including OpenRouter, Anthropic, Google, Groq and OpenAI, or an OpenAI-compatible API such as Ollama or LM Studio
  • Use Add API key to save, rotate, or remove a provider key. A saved key is shared by both steps when they use the same provider. API keys are encrypted in SQLite with a local key file and never sent back to the browser. Back up data/provider-key.bin alongside the SQLite data to preserve them.
  • For Local Granite Speech, click Install Granite to download the 2.35 GB GGUF. The worker resumes partial downloads and verifies the checksum before using the file. GRANITE_MODEL_PATH can point to a compatible GGUF already on disk, including the one used by ins video.
  • For a custom detection server, enter the OpenAI-compatible base URL ending in /v1 and the server's model ID. For a custom transcriber, enter the full /audio/transcriptions URL. It must return structured word or segment timestamps in seconds. Both endpoints accept an optional API key.
  • Hosted transcription receives audio clips. Hosted ad detection receives timestamp-indexed transcript excerpts. Use Granite with a local detection endpoint to keep both steps on your own server.

Add and prepare a podcast #

  1. Click Add podcast and paste its RSS URL.
  2. Podstuff queues the latest three episodes on import and newly published episodes on refresh. Expand a podcast and use Detect ads to prepare the newest three, newest ten, or all eligible episodes. Each episode also has its own detection button.
  3. Click Subscribe and choose Pocket Casts, AntennaPod, or copy the private RSS URL into any player that accepts custom feeds. The feed's stable enclosure URLs resolve to the current version. Playback uses the original audio while an episode is queued, unprocessed, or has no detected ads. If your player already downloaded the original, remove its download and fetch it again after analysis.

Listen from another device #

Serve Podstuff through an HTTPS reverse proxy and set PUBLIC_BASE_URL to that origin and ADMIN_PASSWORD to a strong password. The dashboard username is admin. See the example environment file. The RSS and enclosure links contain the access token and work without the dashboard password. Pocket Casts needs to reach the public origin from its own servers. AntennaPod can use an origin it can reach from the phone.

Storage and playback #

Podstuff saves feed metadata, ad timestamps, and the detected breaks’ transcript excerpts in SQLite. Click a timestamp under Cuts to read its excerpt. Older analyses require reanalysis to add excerpts. The worker decodes bounded audio windows in memory and uses an on-disk Pi Durable checkpoint for the current window. If the model returns invalid ad boundaries, the worker can retry that window with the saved transcript. After a failure, Retry rereads the source and reuses completed windows whose audio and settings still match. Successful analysis clears the checkpoints. The Granite weights are cached separately if you install them.

Edited audio is fetched, cut, and encoded for each request. Podcast clients can seek or resume via standard HTTP byte ranges. A late seek still requires reading and encoding the earlier source audio, so seek time depends on the upstream host, episode length, and server speed. FFmpeg processes common streaming-friendly podcast formats. Some containers require a seekable source and fall back to original playback if analysis fails.

Ad detection can miss ads or cut the wrong material. Podstuff invalidates cuts when the source enclosure or its available validators change. Hosts that rotate dynamic ads without changing those identifiers can still deliver a different edit source.

Development #

The library uses Drizzle with Bun SQLite. Edit lib/schema.ts and run bun run db:generate to generate migrations in drizzle/. Podstuff applies those migrations when it opens the library. The baseline migration adopts existing library.sqlite files in place.

MIT licensed.