podcast2tonie.txt (14.8 KB)
This Bash script automates the process of downloading the latest episode from a podcast feed, converting it for use with TeddyCloud (via TonieToolbox), and managing the episode history. It also optionally sends notifications.
What the Script Does
- Downloads the latest episode from a given podcast feed URL.
- Converts the downloaded MP3 file into a .taf file using TonieToolbox (inside a Docker container).
- Saves the converted .taf file into a specified TeddyCloud library subfolder.
- Keeps a history file to avoid processing the same episode twice (unless forced).
- Supports optional notification through ntfy.sh.
- Supports verbose debug logging.
How to Use
./scriptname.sh --url <PODCAST_FEED_URL> --cloudfolder <TEDDYCLOUD_SUBFOLDER> [--cloudfilename <FILENAME>] [--ntfy <NTFY_URL>] [--force] [--debug]
Required Arguments
--url
: URL of the podcast feed (e.g., an RSS or Atom feed link).--cloudfolder
: Subfolder inside the TeddyCloud library for storing the .taf file (no slashes at the beginning or end).
Optional Arguments
--cloudfilename
: Custom filename for the saved .taf file (default: latest.taf).--ntfy
: Full ntfy.sh endpoint URL for push notifications on script completion or error.--force
: Force download and process even if the episode was already handled.--debug
: Enable detailed debug logging to a log file.
Example Usage
./podcast_downloader.sh --url https://example.com/podcast.rss --cloudfolder Maus/Podcasts --cloudfilename latest.taf --ntfy https://ntfy.sh/mypodcast --debug
This will grab the most recent podcast episode, convert it to a TeddyCloud-compatible format, store it in the specified cloud folder, and send notification updates.
Note #1:
You’ll need Docker, TonieToolbox Docker image, jq
, and curl
installed for the script to work. The script assumes a particular TeddyCloud directory structure and file permissions.
Note #2:
also open the script and edit:
TEDDY_CLOUD_BASE="/opt/teddycloud-0.6.3/data/library"
to fit your environment