gen_feed.py is a script demonstrating how to use the feedgen library to generate a podcast RSS feed from a directory of mp3 files.
- Python 3.6 or greater
pip install feedgen
All of the mp3 files and the cover image file (optional) should be in the same directory. The feed will be ordered by sorting the mp3 file names alphabetically.
Links in the RSS feed will all be made relative to the --site argument.
usage: gen_feed.py [-h] --title TITLE [--description DESCRIPTION] --site SITE
[--cover COVER] [--path PATH]
Generate a podcast RSS feed for a directory of mp3 files.
optional arguments:
-h, --help show this help message and exit
--title TITLE, -t TITLE
Podcast title
--description DESCRIPTION, -d DESCRIPTION
Podcast description
--site SITE, -s SITE Root URL to base feed links on
--cover COVER, -c COVER
Cover image file name
--path PATH, -p PATH Path containing source files
For this example, we go through the steps of converting an audiobook from Audible that you legally own into a locally hosted podcast. A similar process works for any collection of mp3 files.
-
Download the .aax file.
-
Extract your auth code with audible-activator.
-
Use the auth code to convert the .aax file into a directory of mp3 files with AAXtoMP3.
-
(Optional) Download a cover art file for the RSS feed.
-
Run gen_feed.py on the directory of mp3 files. For example, if the working directory is the directory with the mp3 files and cover.jpg and one's laptop host name was
mylaptop.lan, one could do:gen_feed.py --title "My Book" --cover cover.jpg --site http://mylaptop.lan:8000 > podcast.xml -
Serve the feed and files by running
python -m http.serverin the directory with the feed and files. This is assuming you only plan to access the files on your local LAN. Otherwise, a more robust file server should be used. -
Subscribe to
http://mylaptop.lan:8000/podcast.xmlin your podcatcher.