Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

podcast-dl

lightpohl899MIT11.4.0

A CLI for downloading podcasts.

podcast, podcasts, downloader, cli

readme

podcast-dl

A humble CLI for downloading and archiving podcasts.

How to Use

npx

Node Required

npx podcast-dl --url <PODCAST_RSS_URL>

Binaries

Visit the releases page and download the latest binary for your system.

podcast-dl --url <PODCAST_RSS_URL>

More Examples

Options

Either --url or --file must be provided.

Type values surrounded in square brackets ([]) can be used as boolean options (no argument required).

Option Type Required Description
--url String true* URL to podcast RSS feed.
--file String true* Path to local RSS file.
--out-dir String false Specify output directory for episodes and metadata. Defaults to "./{{podcast_title}}". See "Template Options" for more details.
--threads Number false Determines the number of downloads that will happen concurrently. Default is 1.
--attempts Number false Sets the number of download attempts per individual file. Default is 3.
--archive [String] false Download or write out items not listed in archive file. Generates archive file at path if not found. Defaults to "./{{podcast_title}}/archive.json" when used as a boolean option. See "Template Options" for more details.
--episode-template String false Template for generating episode related filenames. See "Template Options" for details.
--episode-custom-template-options <String...> false Provide custom options for the episode template. See "Template Options" for details.
--include-meta | false Write out podcast metadata to JSON.
--include-episode-meta | false Write out individual episode metadata to JSON.
--include-episode-images | false Download found episode images.
--include-episode-transcripts | false Download found episode transcripts.
--offset Number false Offset starting download position. Default is 0.
--limit Number false Max number of episodes to download. Downloads all by default.
--after String false Only download episodes after this date (i.e. MM/DD/YYYY, inclusive).
--before String false Only download episodes before this date (i.e. MM/DD/YYYY, inclusive).
--episode-regex String false Match episode title against provided regex before starting download.
--episode-regex-exclude String false Episode titles matching provided regex will be excluded.
--episode-digits Number false Minimum number of digits to use for episode numbering (e.g. 3 would generate "001" instead of "1"). Default is 1.
--episode-num-offset Number false Offset the acquired episode number. Default is 0.
--episode-source-order String false Attempted order to extract episode audio URL from RSS feed. Default is "enclosure,link".
--episode-transcript-types String false List of allowed transcript types in preferred order. Default is "application/json,application/x-subrip,application/srr,application/srt,text/vtt,text/html,text/plain".
--season Number false Only download episodes from specified season. Note: this will only work if the RSS feed includes the itunes:season tag on episodes.
--add-mp3-metadata | false Attempts to add a base level of episode metadata to each episode. Recommended only in cases where the original metadata is of poor quality. (ffmpeg required)
--adjust-bitrate String (e.g. "48k") false Attempts to adjust bitrate of episodes. (ffmpeg required)
--mono | false Attempts to force episodes into mono. (ffmpeg required)
--override | false Override local files on collision.
--always-postprocess | false Always run additional tasks on the file regardless if the file already exists. This includes --add-mp3-metadata, --adjust-bitrate, --mono, and --exec.
--reverse | false Reverse download direction and start at last RSS item.
--info | false Print retrieved podcast info instead of downloading.
--list [String] false Print episode list instead of downloading. Defaults to "table" when used as a boolean option. "json" is also supported.
--exec String false Execute a command after each episode is downloaded. See "Template Options" for more details.
--parser-config String false Path to JSON file that will be parsed and used to override the default config passed to rss-parser.
--user-agent String false Specify custom user agent string for HTTP requests. Defaults to a Chrome user agent if not specified.
--proxy | false Enable proxy support. Specify environment variables listed by global-agent.
--help | false Output usage information.

Archive

  • If passed the --archive [path] option, podcast-dl will generate/use a JSON archive at the provided path.
  • Before downloading an episode or writing out metadata, it'll check if the item was saved previously and abort the save if found.

Template Options

Options that support templates allow users to specify a template for the generated filename(s) or option. The provided template will replace all matched keywords with the related data described below. Each keyword must be wrapped in two braces like so:

--out-dir "./{{podcast_title}}"

--episode-template "{{release_date}}-{{title}}"

--out-dir & --archive

  • podcast_title: Title of the podcast feed.
  • podcast_link: link value provided for the podcast feed. Typically the homepage URL.

--episode-template

  • title: The title of the episode.
  • release_date: The release date of the episode in YYYYMMDD format.
  • release_year: The release year (YYYY) of the episode.
  • release_month: The release month (MM) of the episode.
  • release_day: The release day (DD) of the episode.
  • episode_num: The position number of where the episode appears in the feed.
  • url: URL of episode audio file.
  • duration: Provided mm:ss duration (if found).
  • podcast_title: Title of the podcast feed.
  • podcast_link: link value provided for the podcast feed. Typically the homepage URL.
  • guid: The GUID of the episode.

--episode-custom-template-options

Each matcher provided will be used to extract a value from the episode title. Access these values in the template using the custom_<n> keyword where <n> is the index of the matcher provided (starting from 0).

If no match is found, the custom_<n> keyword will be replaced with an empty string.

--exec

  • episode_path: The path to the downloaded episode.
  • episode_path_base: The path to the folder of the downloaded episode.
  • episode_filename: The filename of the episode.
  • episode_filename_base: The filename of the episode without its extension.
  • url: URL of episode audio file.

Template Filters

Template variables can be transformed using filters. Filters are applied using the pipe (|) character and can be chained:

--episode-template "{{podcast_title|underscore}}-{{title|strip_special|camelcase}}"

For example, given title = "Serial- S01 E01: The Alibi":

  • {{title|strip_special|underscore}} produces Serial S01 E01 The Alibi then Serial_S01_E01_The_Alibi
  • {{title|strip_special|camelcase}} produces SerialS01E01TheAlibi

Available Filters

Filter Description Input Output
strip Remove all whitespace "foo bar" "foobar"
strip_special Remove non-alphanumeric chars (except spaces) "S01: E01!" "S01 E01"
underscore Replace whitespace with underscores "foo bar" "foo_bar"
dash Replace whitespace with dashes "foo bar" "foo-bar"
camelcase Convert to UpperCamelCase "foo bar" "FooBar"
lowercase Convert to lowercase "FOO Bar" "foo bar"
uppercase Convert to UPPERCASE "foo bar" "FOO BAR"
trim Remove leading/trailing whitespace " foo " "foo"

Log Levels

By default, all logs and errors are outputted to the console. The amount of logs can be controlled using the environment variable LOG_LEVEL with the following options:

  • static: All logs and errors are outputted to the console, but disables any animations.
  • quiet: Only important info and non-critical errors will be logged (e.g. episode download started).
  • silent: Only critical error messages will be logged.

OS Filename Limits

By default, the max length of a generated filename is 255. If your OS has different limitations, or if you're running into issues with non-standard feeds, you can adjust the limit via the environment variable MAX_LENGTH_FILENAME.

changelog

Changelog

11.4.0 (2025-12-31)

Features

  • add support for simple template filters (84d7105)

11.3.0 (2025-12-01)

Features

  • add support for specifying '--user-agent' (#119) (8a20489)

11.2.0 (2025-11-12)

Features

  • add option to filter downloads by season (#116) (4be7b8b)

11.1.2 (2025-09-17)

Bug Fixes

  • handle invalid image objects found in some RSS feeds (2a8f643)

11.1.1 (2025-07-17)

Bug Fixes

  • skip problematic ffmpeg metadata on Windows (abb9ca5), closes #109

11.1.0 (2025-05-30)

Features

11.0.1 (2025-05-28)

Bug Fixes

  • do not enforce higher Node engine version (3a2adcb), closes #104

11.0.0 (2025-05-22)

⚠ BREAKING CHANGES

  • update to Node 22 LTS
  • remove legacy archive behavior

Features

  • always attempt image embed with '--add-mp3-metadata' (644bcf7)
  • remove legacy archive behavior (85d51d4)

Bug Fixes

  • do not embed image if '--add-mp3-metadata' is not provided (644bcf7)

Miscellaneous Chores

10.5.0 (2025-05-18)

Features

  • embed episode artwork if available when ffmpeg is run (34eac22), closes #100

Bug Fixes

  • use 'contentSnippet' for mp3 metadata comment (fc92fed)

10.4.1 (2024-12-11)

Bug Fixes

  • properly escape params passed to exec (2a65931)
  • properly escape params passed to ffmpeg (88df918), closes #95

10.4.0 (2024-12-05)

Features

  • add 'episode-regex-exclude' option (553c799), closes #91

10.3.3 (2024-11-28)

Bug Fixes

  • ignore servers with incorrect 'Accept' handling (52f2d69)

10.3.2 (2024-11-07)

Bug Fixes

  • spoof user agent to avoid occasional blocks (494c74b), closes #89

10.3.1 (2024-11-01)

Bug Fixes

  • handle file feeds with missing 'feedUrl' (1e6b89a), closes #87

10.3.0 (2024-10-09)

Features

  • add 'url' template option to '--exec' (6f305c1)

10.2.0 (2024-08-29)

Features

  • add 'release_month' and 'release_day' template options (27c2e8b)

10.1.0 (2024-08-25)

Features

  • add 'release_year' option for episode template (223022e)

10.0.0 (2024-08-24)

⚠ BREAKING CHANGES

  • add 'episode-custom-template-options' (#79)

Features

  • add 'episode-custom-template-options' (#79) (d280eea)

9.5.0 (2024-05-29)

Features

  • support fetching available episode transcripts (43e6c6c)

9.4.0 (2024-05-26)

Features

  • add '--episode-num-offset' option (7a742c5)

9.3.4 (2024-04-30)

Bug Fixes

  • handle feeds that block 'HEAD' check (23b6b5d)

9.3.3 (2024-04-13)

Bug Fixes

  • fallback to provided URL if 'feedUrl' cannot be parsed (d944bdf)

9.3.2 (2024-04-13)

Bug Fixes

  • add opus to audio types (4973683)

9.3.1 (2024-02-17)

Bug Fixes

  • remove leftover console.log (3135661)

9.3.0 (2024-02-17)

Features

  • add support for '--file' parsing (70254f3), closes #64

9.2.2 (2023-12-31)

Bug Fixes

  • avoid escaping complex args in Windows (11b9f6a)

9.2.1 (2023-12-31)

Bug Fixes

  • add better escape logic for mp3 metadata with ffmpeg (7a4289f), closes #60

9.2.0 (2023-12-05)

Features

  • support directory paths in '--episode-template'

9.1.0 (2023-10-09)

Features

  • add flag to postprocess existing files

Bug Fixes

  • allow ffmpeg options to be run on all filetypes

9.0.3 (2023-10-07)

Bug Fixes

  • fix and enhance the --add-mp3-metadata flag

Features

  • add guid to episode template

9.0.2 (2023-09-10)

Bug Fixes

  • prevent all exts from causing file name limit issues

Features

  • allow override of MAX_LENGTH_FILENAME via env variable

9.0.1 (2023-09-09)

Bug Fixes

  • prevent ".tmp" files causing file name limit issues
  • --episode-source-order using incorrect default value

9.0.0 (2023-09-08)

⚠ BREAKING CHANGES

  • keys generated for the archive will use the full and unaltered titles
  • pull from item enclosure first when looking for episode downloads

Features

  • add --attempts and support automatic retries
  • add --episode-source-order for better support of problematic feeds

8.0.8 (2023-07-21)

Bug Fixes

  • handle invalid URLs when attempting to find audio file URL
  • more gracefully handle initially empty archive files
  • remove an inaccurate log message when download extra items for an episode

8.0.7 (2023-07-09)

Bug Fixes

  • meta and episode image filenames should respect --episode-digits

8.0.6 (2023-05-17)

Bug Fixes

  • handle feeds where audio files are missing exts

8.0.5 (2023-03-27)

Features

  • add --episode-digits to allow episode number to be padded with leading zeroes

8.0.4 (2023-02-27)

Bug Fixes

  • '--out-dir' and '--archive' incorrectly generating nested folders

8.0.3 (2023-02-11)

Features

  • add --proxy flag to enable proxy support via ENV variables

8.0.2 (2023-02-04)

Features

  • make 'episode_num' available for '--episode-template' templating

Bug Fixes

  • increase timeout check for slower servers

8.0.1 (2023-02-04)

Bug Fixes

  • feed meta should not include items meta

8.0.0 (2023-02-04)

⚠ BREAKING CHANGES

  • remove '--filter-url-tracking' experimental flag
  • include all properties in metadata from rss-parser
  • make '--exec' templating options more consistent

Features

  • add '--parser-config' option (e70eaac)

Bug Fixes

  • do not log feed info when using '--list' (1bb340b)

7.3.2 (2022-04-13)

Bug Fixes

  • limit filtering should be applied last (e2db23a)

7.3.1 (2022-04-11)

Bug Fixes

  • limit success message to > 0 episodes downloaded (e7c189b)
  • prevent podcast images from downloading if already archived (c1a7440), closes #39

7.3.0 (2022-04-09)

Features

  • add success/failure message at end of downloads (a785c73)
  • do not include null values in JSON output (70f1dac)

Bug Fixes

  • remove unnecessary file size warning (96a48b2)

7.2.0 (2022-03-05)

Features

  • write to temp files while downloading (dae7938), closes #37

7.1.0 (2021-11-17)

Features

  • add '--filter-url-tracking' option (9e7365f)

7.0.0 (2021-10-23)

⚠ BREAKING CHANGES

  • support multiple downloads with '--threads' (#34)

  • add '--include-episode-images', remove '--ignore-episode-images'

  • check for ffmpeg during validation if option requires it

  • specify Node 14 LTS

Features

  • support multiple downloads with '--threads' (#34) (c4ee9c6)

  • add '--include-episode-images'

6.1.0 (2021-08-15)

Features

  • add 'static' log level support (66b5934), closes #32

Bug Fixes

  • cleanup any temp files if ffmpeg fails (c4a5408)

6.0.0 (2021-08-13)

⚠ BREAKING CHANGES

  • consolidate '--list' and '--list-format'

Features

  • consolidate '--list' and '--list-format' (ce47051)

Bug Fixes

  • better error message when archive write fails (42de1f0)
  • issue with '--archive' default (551c0a8)

5.4.0 (2021-08-13)

Features

  • add '--before' and '--after' options (a45e95a), closes #31
  • add default path when '--archive' is enabled (8100739)

Bug Fixes

  • don't create folder when running info commands (0a3e884)
  • log a message when ffmpeg starts (037f448)

5.3.0 (2021-08-11)

Features

5.2.0 (2021-08-11)

Features

  • add '--adjust-bitrate' option (029ef66)

5.1.0 (2021-08-08)

Features

  • add '--list-format' options (c68aa43), closes #29
  • allow '--list' to support filtering options (0dda386), closes #28
  • filter with '--episode-regex' before starting downloads (6690a82)

5.0.2 (2021-08-03)

Bug Fixes

  • output path incorrectly set (03d99fb)

5.0.1 (2021-08-03)

Bug Fixes

  • log item info when skipped due to conflict or existing in archive (7a324e6)

5.0.0 (2021-07-31)

⚠ BREAKING CHANGES

  • exit with error code 2 when no episodes are downloaded (#27)

Features

  • add --exec option (#25) (f39966f)
  • exit with error code 2 when no episodes are downloaded (#27) (0ef921e)

Bug Fixes

  • move onAfterDownload to after error checks (f148041)
  • only run --add-mp3-metadata on new downloads (e06a7e9)

4.3.1 (2021-05-09)

Bug Fixes

  • always log error messages that trigger an exit (e856f3c)
  • gracefully handle feed items missing audio extensions (b0a03de), closes #24
  • missing newline when download exits on error (2672676)

4.3.0 (2021-04-10)

Features

  • add support for LOG_LEVEL env variable (3a2deb0), closes #22

4.2.0 (2021-03-13)

Features

4.1.4 (2021-02-20)

Bug Fixes

  • check enclosure for audio type/ext if file is missing ext (58bcc4b)

4.1.3 (2021-01-27)

4.1.2 (2021-01-22)

Bug Fixes

  • disable download progress logging in non-TTY envs (c0f0dde)

4.1.1 (2020-12-29)

Bug Fixes

  • the most recent episode should be downloaded when using '--reverse' (709312b), closes #16

4.1.0 (2020-08-15)

Features

  • add templating support to '--archive' option (f8ed4fb), closes #15

4.0.1 (2020-08-09)

Bug Fixes

  • include generic accept header for compatibility with some podcast servers (a12b1da), closes #13

4.0.0 (2020-08-01)

Breaking Changes

  • remove --prompt option

Features

  • add '--episode-regex' option (24c74ba)

3.0.1 (2020-07-15)

Bug Fixes

  • better handle missing properties for name templating (ae25272)

3.0.0 (2020-07-04)

Breaking Changes

  • guard against overriding local files
  • add '--override' flag for previous behavior

2.0.0 (2020-06-06)

Breaking Changes

  • add recursive flag to mkdir for '--out-dir'
  • use podcast title in meta file name if available
  • default '--out-dir' to podcast specific folder
  • include podcast title name in feed image

1.6.1 (2020-05-24)

Bug Fixes

  • do not show "100%" progress when dowload first starts (3bc3152)

1.6.0 (2020-05-17)

Features

  • add podcast title/link templating options to '--out-dir' (b4c526b)

1.5.0 (2020-05-17)

Features

  • add '--episode-template' option (93044d5), closes #4

1.4.6 (2020-05-11)

Bug Fixes

  • do not archive if file fails to save (dfe9656)

1.4.5 (2020-05-10)

Bug Fixes

  • infinite error after unable to find episode URL (43817d6)

1.4.4 (2020-05-10)

Bug Fixes

  • add HEAD check before asset downloads (2b6edf2)

1.4.3 (2020-05-09)

1.4.2 (2020-05-09)

Bug Fixes

  • add download cleanup on error: (978db00)

1.4.1 (2020-05-09)

Bug Fixes

  • episode images should not override episodes (7716bdc)

1.4.0 (2020-05-09)

Features

Bug Fixes

  • 'episodes' typo in prompt after selecting episodes (6e06ec3)

1.3.1 (2020-05-08)

Bug Fixes

  • counter in prompt loop incorrect (2f2f0ae)

1.3.0 (2020-05-08)

Features

  • add basic --prompt option (225db58)

1.2.0 (2020-05-07)

Features

  • add --list option for episode data (90b3b80)
  • add --reverse option (dcae39c)

1.1.1 (2020-04-30)

1.1.0 (2020-04-27)

Features

  • add --offset and --limit options (b71bc91)

Bug Fixes

  • only pluralize episodes when not 1 item (9449899)

1.0.2 (2020-04-26)

Bug Fixes

  • incorrectly referenced bin (921a887)

1.0.1 (2020-04-26)

1.0.0 (2020-04-26)

Features

  • add initial download script (166426a)
  • add metadata retrieval options (912062a)