Skip to main content
  1. Dispatches/

TIL - Podcast hosts serve unreliable art mime types

·362 words·2 mins
TIL Podcasting Python Django Mime Types Rss
Daniel Andrlik
Daniel Andrlik lives in the suburbs of Philadelphia. By day he manages product teams. The rest of the time he is a podcast host and producer, writer of speculative fiction, a rabid reader, and a programmer.

I’ve been toying with a small Django project that can be given a list of podcast feeds, and then regularly checks those feeds to update some interesting metrics. Initially, I wanted to see how many comparable podcasts to my own made use of various RSS namespace elements,1 and also to pull some aggregate statistics around release frequency, episode length, etc.2

Since I was making a simple UI for myself, I decided to add in the ability to fetch and cache cover art of the podcast, updating it if the URL changes in subsequent checks. And here I noticed something odd. I was limiting the mime types that would be accepted in case garbage data was returned,3 but then I noticed that two podcasts in my initial set were never caching the artwork, even though the secondary checks on the file itself appeared showed valid types! When I dug deeper I found that the issue is with their hosts, which will happily return invalid or imprecise mime types in the Content-Type header.

For example, if the cover art uploaded to Spotify/Anchor ends in .jpg, it will deliver the file with mime type image/jpg, which does not exist. It should be sending it back as image/jpeg, and suggests to me they may be serving the designation by concatenating the file extension onto the the end of image/, which strikes me as a really bad idea., on the other hand, doesn’t even try to do the right thing, and reports any file type as application/octet-stream. 🀦

Now, I’m off to add some code to add a datapoint on these types of errors so that over time I can identify how many hosts are doing this!

UPDATE: Looks like Libsyn also does the application/octet-stream thing.

  1. Some examples include:

    • iTunes feed type
    • Season data
    • Person elements for host/guest
    • Transcript
    • Funding
    • Use of CW/TW in descriptions
    • Explicit tags
    • Uses RSS chapters for podcast
  2. This is how I know as of when I’m writing this that if you were to listen to our podcast from start to finish without breaks, it would take you 9 days, 9 hours, 38 minutes, and 40 seconds. ↩︎

  3. Smart thinking, Past Me! ↩︎


Fun With Django Feeds
·1140 words·6 mins
Articles Atom Development Django Howto Python Rss
I would like to take a moment to show you how easy it is to create feeds in Django, and the easiest way to do that is by example. For brevity’s sake, I’m going to use a simplified version of a Django-powered blog.
Weeknotes for 2024-04-05
·252 words·2 mins
Weeknotes Personal Python Django Hugo Tv Indieweb Explorers Wanted
At this rate I might have to rename this segments to Monthnotes. So let’s at least talk about the last two weeks, shall we? Python, podcasting, media, oh my.
TIL - Getting asdf Python with tkinter working on a M2 Mac
·312 words·2 mins
TIL Macos Python Homebrew Tkinter
This week I wanted to play around with tkinter a bit. But this proved to be difficult on my M2 Mac. I use asdf to manage various runtime versions, so first I checked to see if it was already working with my existing Python installation using the built in test method.