Configure filename and directory templates
mainpodcast-dl supports dynamic templates for filenames and directories using double braces {{keyword}}. These keywords are replaced with metadata from the podcast feed or specific episodes.
Template Keywords for --out-dir and --archive
podcast_title: Title of the podcast feed.podcast_link: Thelinkvalue from the podcast feed (usually the homepage URL).
Template Keywords for --episode-template
title: Episode title.release_date: Date inYYYYMMDDformat.release_year: Year (YYYY).release_month: Month (MM).release_day: Day (DD).episode_num: Position in the feed.url: URL of the audio file.duration: Duration inmm:ssformat.podcast_title: Title of the podcast feed.podcast_link: Link to the podcast feed.guid: The episode's GUID.
Custom Matchers via --episode-custom-template-options
You can use regex matchers to extract values from the episode title. These are accessed in templates using custom_<n>, where <n> is the zero-based index of the matcher. If no match is found, it results in an empty string.
Template Keywords for --exec
When using the --exec command, the following variables are available:
episode_path: Full path to the downloaded episode.episode_path_base: Directory containing the episode.episode_filename: Filename including extension.episode_filename_base: Filename without extension.url: URL of the audio file.
# Example: Organize by podcast title and use a date-title format for episodes
podcast-dl --out-dir "./{{podcast_title}}" --episode-template "{{release_date}}-{{title}}" [RSS_URL]