Skip to content


Repository files navigation

⏮ Cast Rewinder

Subscribe to podcasts from the beginning!

What’s the deal?

Cast Rewinder allows you to subscribe to a podcast from the beginning.

Every so often I discover a podcast that sounds really great, but it has started publishing episodes for so long that it’s a chore to go back at the beginning.

Now with Cast Rewinder you can subscribe to that podcast and get updates, starting from the beginning. You can set the frequency (monthly, weekly, daily… and even on specified days of the week) and other options, like the feed format or at which episode in the feed to start your discovery.

Cast Rewinder runs

The idea originates from Brendan Hutchins in the podcast Bitrate, in June 29th, 2018 episode. Thanks for the inspiration!

It’s one of my first real coding projects. I’m a webdesigner who dabbles in Python, and I wanted to scratch an itch. I don’t know anything about software architecture and very little about databases. If you have suggestions for better, nicer, cleaner ways of doing things, please open an issue!


Demo on


Install Python 3.7, pypi (the Python Package Manager) and PostgreSQL (the database) on your server.

$ sudo apt-get install python3 pypi postgresql

Create a virtual environment like this:

$ python -m venv .venv

Activate it with:

$ source .venv/bin/activate

Install the requirements:

(.venv) $ pip install -r requirements.txt

Create the user (if needed) and database:

(.venv) $ createdb castrewinder   

Copy to ./instances/, and edit your preferences (using Nano, Ctrl-O saves, and Ctrl-X exits the editor). APP_SECRET_KEY and WTF_CSRF_SECRET_KEY must be randomly generated strings.

(.venv) $ cp ./instances/
(.venv) $ nano ./instances/

Generate the compiled *.mo translation files (for more info on translations, check out Flask-Babel documentation):

(.venv) $ pybabel compile -d translations

Then run the install script:

(.venv) $ python



When developing, run it via the run script:

(.venv) $ python


What you really want is to read this doc :

On I used uWSGI and nginx, on an Ubuntu machine, and it seems to be working.


If you read this, let’s hope you know what you do. Anyways, migrations are taken care of by Flask-Migrate.

First, init the DB:

(.venv) $ FLASK_APP=castrewinder flask db init

Then you can upgrade whenever necessary:

(.venv) $ FLASK_APP=castrewinder flask db upgrade head

Cron job

Here is the line for the Cron job that’ll update the feeds every day at 3 in the morning (server time).

0 3 * * * cd ~/Cast-Rewinder/ ; . ~/Cast-Rewinder/.venv/bin/activate ; ~/Cast-Rewinder/.venv/bin/python ~/Cast-Rewinder/ -u

You could use a different update frequency setting. As this app is geared mostly towards old / defunct podcasts with big back catalogs, I don’t know if there’s a need for hourly updates. Anyways, if you need other options, check


  • Importing multiple feeds via OPML files (and exporting the new URLS as an OPML file)
  • Editing existing feed URLS to change options, etc.
  • HTML preview

Copyrights and License

Unless otherwise specified, this code is copyright 2018 Joachim Robert and released under the GNU Affero General Public License v3.0. Learn more about this license :

This work uses code from: