The Hidden Blog

As it turns out, I do have a hostname.

Building my own podcast feed (+ Overcast issues)

Published on Sep 10, 2024

I recently had the idea to use Apple Shortcuts to play a specific podcast episode every morning. This seemed like a fun and relatively quick task, but turned out to be a bit more work (as usual) that is also not fully complete yet.

The basic idea was to use an API of a public Austrian broadcaster, filter for the episodes I want to listen to and then build a simple podcast feed that I then can subscribe to in my podcast player of choice, Overcast.

It wasn't as easy as I thought as the streaming didn't work in the podcast app so I had to download the audio file. Then I decided that I wanted to store the metadata along side the audio file I also had to download that and store it too. I then realized that podcast feeds only allow square images, so I had to download their images on every refresh. If there's no square image provided I have to programmatically create a square image out of the existing rectangular one. The download of the files was pretty slow so I had to build it in a concurrent way, and as I didn't want to redownload existing assets I also had to create a caching system. Then there were also some podcast feed format specific edge cases that had to be take care of. Overall it took me a few hours over a few days.

I then created a simple web interface with direct links to my API routes that I can use to refresh and generate feeds on a schedule. There's no complicated scheduling logic needed as it just uses a cron job.

0 7 * * * curl -fsS -m 20 --retry 2 -o /dev/null https://feed.example.com/refresh && curl -fsS -m 20 --retry 2 -o /dev/null https://feed.example.com/refresh/generate && curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/unique-uuid-for-healthcheck

My beautiful web interface:

The files are stored in a simple file structure like the following, the json file holds the raw data from the provider as a source of truth. Every show contains one artwork and one atom.xml feed.

.
├── 200872
│   ├── 200872.json
│   └── 200872.mp3
├── 201693
│   ├── 201693.json
│   └── 201693.mp3
├── 201752
│   ├── 201752.json
│   └── 201752.mp3
├── artwork.jpg
└── atom.xml

This all works nicely, except that Overcast seems to have cached my feed somehow and I'm a bit at a loss on how to fix that. I've reached out to the Overcast Slack and other users there could confirm that, they also see the outdated feed. This makes it clear that this is not device specific. Using curl to download the feed shows a completely different feed, while the cached one is a very early debugging version with duplicate episodes and wrong titles.

I then tried to mitm the Overcast app to see if it's somehow fetching the feed from some Overcast cache server, but that doesn't seem to be the case as pull-to-refresh is always hitting my server, and is receiving the correct response.

The Overcast API I can't debug as it uses cert pinning.

Any ideas?