How to download mp3s of old This American Life episodes from the Archive

First of all, if you really like This American Life, you should be donating!

Donate to This American Life

I’m sure you’re already doing that though, and you just want an easier way to download old episodes from the archive, right?

Right.

The URLs for archived This American Life episodes have a lot of random characters in them (e.g. something like this: https://stream.thisamericanlife.org/644/jKcM-Kr7eDIbeEEe-6T3uezfS6Fj_PtP7mtqglncHsw/644.mp3). This makes it impossible to just replace the episode number with the one you want to download.

My strategy involves using a bookmarklet, which is just like a normal bookmark except it runs some JavaScript code instead of taking you to a different website when you click on it.

First you visit the archive page for an episode you want to download, like https://www.thisamericanlife.org/644/random-acts-of-history, then click the bookmarklet, and the misleading “Download” link will be replaced with an actual download link.

Here’s the code that I came up with:

var url = JSON.parse(document.querySelector('#playlist-data').innerHTML).audio;
var downloadListItem = document.querySelector('li.download');
downloadListItem.innerHTML = '<a href="' + url + '" download>Actual Download</a>';

And here is a link to the bookmarklet itself, which you can drag and drop into your bookmark bar: Bookmark Me!

Please let me know in the comments if you run into any problems or have any questions!

Leave a Reply