In recent years, a sizeable amount of great writers, professional or otherwise, have started sharing their wares via Substack. Substack is billed as a platform that lets you write and monetise email newsletters, although any content is generally a;sp available via the web and, sadly for the free stuff only, RSS.
Firstly, I wanted to caveat that there are some good arguments against promoting the use of Substack as a platform.
Anil Dash begs writers to not refer to their body of work as “a Substack” and be wary of their attempt to control your audience and distribution Then there’s the fact that by giving your attention and money to Substack you are inadvertently helping fund a platform that appears happy to profit from hosting literal Nazi newsletters. This has caused some popular outlets to eschew Substack for other options. But the sad truth is that if you want to read the work of certain authors it’s currently Substack or nothing, so you’ll have to decide for yourself.
Assuming one does want to get involved, or at least read a given outlet’s back catalogue before quitting the platform oneself, it would be nice to be able to both 1) search and archive the content you care about forever - the internet is, after all, notoriously ephemeral, and 2) be able to read it in the manner that you prefer to, even if that manner is “not connected to the internet and logged into the potentially intrusive substack.com website experience”.
Personally, for longer-form content I prefer to read it on an eReader, something that I’m not aware is easily possible with Substack by default. I would basically like an eBook that is the Substack writer’s content, 1 chapter per post, in chronological order to work my way through.
Whilst this is definitely not functionality native to Substack, thanks to some generous open source software writers, I found a way to do this, even for paid Substacks. Note that this method won’t get you the paid content from Substacks that you don’t pay for! It’s not a hack. And neither should it. But it will let you extract and reformat the content you have already paid for as you wish.
There’s two phases. First, downloading the all the relevant content of a Substack publication into an archive. Second, convert that archive into an ebook, for which here I basically mean an epub file given that format is easy to use with all the common eReaders that I’m aware of. Of course if you just want a local copy of the Substack for archival or offline purposes then you could stop after step 1.
Here’s what worked for me:
Step 1: Download a local copy of all the relevant Substack posts.
For this we can use Alex Ferrari’s free and open-source Substack Downloader. This is a command-line tool developed precisely for this purpose. It works on Windows, Linux and the Mac. I used the Windows version, simply downloading the latest .exe file from the repo’s releases page.
Once you’ve got the sbstck-dl-win-amd64.exe saved you’re ready to go. I renamed my copy to the shorter name sbstck-dl for convenience as that’s what the documentation refers to. But you don’t have to do that if you don’t mind typing out the longer exe name each time.
The documentation is on the repo’s home page. You can use it to download either a single Substack post or a set of up to all the posts from a particular Substack publication. I wanted the latter.
Open a command prompt in the folder that you the sbstck-dl file is in so you can get to work using it.
First, just to test it was working, I used the list parameter to list, rather than download all the posts. In my below examples I’ll use “The Lead”, url https://national.thelead.uk/, as my example of a Substack, but of course you can use anything you know to be Substack based.
sbstck-dl list --url https://national.thelead.uk/
Once you’re read to download, the most basic use of the command is:
sbstck-dl download --url https://national.thelead.uk/
That will simply download local HTML copies of all the free posts in the publication. It’s as simple as that! But there are various parameters you can use to make the output more appropriate to your specific needs, as well as get the paid posts of any Substack that you already have a paid subscription for.
Controlling what exactly is downloaded
By default the above will retrieve all the text of the posts. When you open them you’ll still see the pictures and attachments, but they’re being pulled from their original online location. If Substack was to delete them they’d be gone.
You can use parameters --download-images and --download-files to grab a local copy, as well as have the local HTML files containing the text of the Substack on your computer rewritten to refer to the downloaded images.
sbstck-dl download --url https://national.thelead.uk/ --download-images --download-files
You can control the size of the images downloaded with the --image-quality parameter, which takes values of high, medium or low. Personally given I’m mostly reading articles where the graphics are largely incidental on a black-and-white ereader I find low is usually fine.
sbstck-dl download --url https://national.thelead.uk/ --download-images --image-quality "medium"
Perhaps you don’t want all the posts ever written! Especially for a news site like my example that might be 1) a lot of posts, and 2) some of which are less relevant. You can download posts after a certain date like this:
sbstck-dl download --url https://national.thelead.uk/ --after "2026-01-05"
There’s an equivalent --before parameter you can use in the same way if you want.
By default everything downloads to the folder you are in when you run the command, with subfolders set up for images and attachments. If you prefer the output to end up somewhere else you can use the -o flag. Here’s how to have things end up in the subfolder “downloads” for instance.
sbstck-dl download --url https://national.thelead.uk/ -o "./downloads"
One particularly great feature is the --create-archive parameter. If you use that then as well as all the individual posts downloading, the software will create a nice index page that provides a lovely list of posts and links to them. You can then open that in your web browser to navigate through the stories rather than open each one individually.
sbstck-dl download --url https://national.thelead.uk/ --create-archive --download-images
I also like the --add-source-url parameter which adds the original URL of each post to the bottom of the post’s contents. If like me you are converting them to read out-of-context then I like to have a way to remember where they originally came from
sbstck-dl download --url https://national.thelead.uk/ --add-source-url
Finally you can choose the output format. As we’ve seen, by default you end up with HTML files that you can open in any web browser. That’s great if you’re on your computer. But if you want to fulfil my actual goal of making them into an epub for reading on an ereader then probably downloading them in markdown format is a better bet. Less potential HTML cruft, and potentially a slightly more straightforward conversion to epub later on.
For that, use the format parameter.
sbstck-dl download --url https://national.thelead.uk/ --format "md"
Plain text is another --format option you can specify by replacing md with txt
There are no doubt other parameters, but those were the ones I’ve ever needed. You can use all these parameter in conjunction with each other to get your perfect output.
Downloading paid Substack articles
This is really the only potentially tricky part. Well, if you know how to locate the actual values of cookies in your web browser then it’s simple. If not, it differs per browser - here’s a guide that covers a few.
Log into Substack on your normal web browser. Then find the contents of either the cookie called substack.sid or connect.sid, whichever is there on your computer. I had substack.sid
Now copy its value.
You then add the --cookie_name and --cookie_value to the above command. The name one should be the name of the cookie (substack.sid in my case) and the value should just be the nonsense-looking contents of the cookie.
You shouldn’t be sharing that value with anyone else, so the one in the below example is fake. The real one was actually a lot longer.
sbstck-dl download --url https://national.thelead.uk/ --cookie_name substack.sid --cookie_val sasfasfsafasfsaf924971204$210493AYx4u$nTd4mEGG.asfaspj0bgc9IU
Do this correctly though and the command will log in and download the full version of all the paid posts, in addition to the free ones.
My usual command
This then the sort of command I’ve been using to get everything I need all together ready for ebookification:
sbstck-dl download --url https://national.thelead.uk/ -o "./downloads" --download-images --image-quality low --format md --add-source-url --cookie_name substack.sid --cookie_val abc123321xyzxxxxxxxxxx
OK, that’s the archiving complete! Enjoy.
If however you want to convert your collection of downloaded substack posts (ideally in markdown format) into an epub, then here is:
Step 2: Convert the archive into an epub ebook.
For this, we can use pandoc, another great free and open-source tool, which is the definitive convert-between-filetypes command line tool for converting between various markup formats.
Download and install the version relevant to your computer from here. Or if, like me, you’re a winget fan you can install it from your Windows computer’s command line via:
winget install --source winget --exact --id JohnMacFarlane.Pandoc
Pandoc is an incredibly comprehensive tool so no way can we go through all the potential command line options here - for that, see their documentation. Instead I’ll just share what worked for me when converting the output of sbstck-dl into epub form.
What you need to do is feed in the list of files you want converting into a command you type into your command-line in this format. My examples assume you downloaded the posts in markdown format as recommended, but it should work fine enough even if in HTML:
pandoc FILE_YOU_DOWNLOADED.md -o "YOUR_FILENAME.epub" --metadata title="TITLE_TO_GIVE_EBOOK" --metadata author="AUTHOR_TO_GIVE_EBOOK" --toc --split-level=1
You should replace the parts in capital letters with the actual file containing the post and values you want your epub to end up with. The toc and split-level part are all about generating a table of contents, one entry per post, which I like, but is entirely optional.
Note however that if you downloaded more than 1 post you probably have several files to convert. You want them all to end up in the same book most likely. If so you can just list them all in the command in the order you want them to appear in the book like this:
pandoc FILE1.md FILE2.md FILE3.md -o "YOUR_FILENAME.epub" --metadata title="TITLE_TO_GIVE_EBOOK" --metadata author="AUTHOR_TO_GIVE_EBOOK" --toc --split-level=1
or, more realistically for a larger substack, specificy “all markdown files in the folder” like this
pandoc *.md -o "YOUR_FILENAME.epub" --metadata title="TITLE_TO_GIVE_EBOOK" --metadata author="AUTHOR_TO_GIVE_EBOOK" --toc --split-level=1
The *.md simply means all files ending in .md. It doesn’t necessarily imply a particular order. So if you want to absolutely make sure that the files end up being ordered alphanumerically in the book - which, given the file names that sbstck-dl produces by default is equivalent to “in chronological order of post date”, you can instead have the computer first assemble a list of the files in order in a variable and pass that variable to pandoc.
Here’s one way to do that that works in Windows powershell. If you are using any different operating system or command prompt then the first part won’t work, but there will be an equivalent that does if you can find it!
# First part creates a list of all .md files in the folder, ordered by filename into a variable called $articles
$articles = Get-ChildItem -Filter "*.md" | Where-Object { $_.Name -ne "index.md" } | Sort-Object Name | Select-Object -ExpandProperty FullName
# Second part is the pandoc command, passing in your ordered list
pandoc $articles -o "YOUR_FILENAME.epub" --metadata title="TITLE_TO_GIVE_EBOOK" --metadata author="AUTHOR_TO_GIVE_EBOOK" --toc --split-level=1
Once you’ve done all the above you should be left with a nice epub file that is formatted well for your ereader! Simply upload it to your ereader and you’re good to go.