Skip to content

Podcasts

Scope: the server's second trade — following podcast feeds, fetching episodes onto your disk, and listening to them with the same progress keeping as books. Proved live with a fixture feed; transcripts t08 and t09. Two behaviours here surprise everyone the first time, and both are in this chapter in bold.

The fixture feed

The lab wrote a small podcast by hand: The Night Ferry, two episodes of synthesised audio and an RSS feed file naming them, served from a plain web server on localhost (the feed and episodes are regenerated by examples/generate-fixtures.sh). A podcast library already existed, pointed at media/Podcasts.

Adding the podcast starts by showing the server the feed:

POST /api/podcasts/feed
  {"rssFeed": "http://127.0.0.1:8899/feed.xml"}
-> 200: "The Night Ferry" by The Almanac Workshop,
        2 episodes, enclosures named

The parse is a preview: the server reads the feed and hands back what it found, before anything is created or downloaded.

The SSRF fence

Getting even that far taught the chapter's first lesson. The first attempt failed with the server's log saying the call to 127.0.0.1 was blocked: Audiobookshelf runs an SSRF request filter — a guard against being tricked into fetching addresses inside your own network — and localhost is exactly what it blocks. The lab restarted its server with SSRF_REQUEST_FILTER_WHITELIST=127.0.0.1 to let the fixture through.

On a real install, feeds live on real hosts and the filter never troubles you. Leave it on. The whitelist exists for the odd legitimate internal feed — and for labs.

Two surprises, both real

Surprise one: adding a podcast does not backfill old episodes. The server's "check for new episodes" found nothing to download for The Night Ferry — because both fixture episodes were dated before the moment the podcast was added, and the checker looks for episodes newer than its last check. A feed you add today starts collecting from today. (The fixture's 2025 dates against the lab's 2026 clock made the gap impossible to miss.)

Surprise two: the create call's download list is ignored. The API documentation describes asking for episodes to download as part of creating a podcast (episodesToDownload); in v2.37.1 the server accepts the call, creates the podcast — and silently downloads nothing. The route that works is the explicit one:

POST /api/podcasts/<id>/download-episodes
  (the episode objects from the feed)
-> 200, and the server log:
   [PodcastManager] Successfully downloaded
     podcast episode "Episode One - Departures"
   [PodcastManager] Successfully downloaded
     podcast episode "Episode Two - The Crossing"

The episodes, on disk and on the wire

The downloads land in the podcast library's folder, one file per episode, named from the episode titles — and here the streaming check has a twist worth teaching (transcript t09):

GET episode one via the API -> 1,921,002 bytes
sha256 streamed == sha256 of the downloaded file: True

the enclosure in the feed was 1,920,661 bytes

The downloaded file is 341 bytes larger than the enclosure it came from. Audiobookshelf rewrites the episode's tags as it downloads — marking it as a podcast episode, adding sort tags, moving the description into the comment field. What streams is the stored file, exactly; it just isn't bit-identical to the feed's original, and a byte count that doesn't match the enclosure is expected, not corruption.

From there an episode is ordinary: it streams, it seeks, and its progress is kept per user exactly like a book's — the same machinery, which is the point of running podcasts through the same house as the books.