⏮ 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 rewind.website.
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!
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
./instances/config.py, and edit your preferences (using Nano, Ctrl-O saves, and Ctrl-X exits the editor).
WTF_CSRF_SECRET_KEY must be randomly generated strings.
(.venv) $ cp config.py ./instances/config.py (.venv) $ nano ./instances/config.py
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 setup.py
When developing, run it via the run script:
(.venv) $ python run.py
What you really want is to read this doc : http://flask.pocoo.org/docs/1.0/deploying/
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
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/feed_worker.py -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 crontab.guru
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 : https://choosealicense.com/licenses/agpl-3.0/
This work uses code from: