podcast-dl 10.1.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -82,7 +82,9 @@ Options that support templates allow users to specify a template for the generat
82
82
 
83
83
  - `title`: The title of the episode.
84
84
  - `release_date`: The release date of the episode in `YYYYMMDD` format.
85
- - `release_year`: The release year of the episode.
85
+ - `release_year`: The release year (`YYYY`) of the episode.
86
+ - `release_month`: The release month (`MM`) of the episode.
87
+ - `release_day`: The release day (`DD`) of the episode.
86
88
  - `episode_num`: The location number of where the episodes appears in the feed.
87
89
  - `url`: URL of episode audio file.
88
90
  - `duration`: Provided `mm:ss` duration (if found).
package/bin/naming.js CHANGED
@@ -30,10 +30,19 @@ const getItemFilename = ({
30
30
  }) => {
31
31
  const episodeNum = feed.items.length - item._originalIndex + offset;
32
32
  const title = item.title || "";
33
+
33
34
  const releaseYear = item.pubDate
34
35
  ? dayjs(new Date(item.pubDate)).format("YYYY")
35
36
  : null;
36
37
 
38
+ const releaseMonth = item.pubDate
39
+ ? dayjs(new Date(item.pubDate)).format("MM")
40
+ : null;
41
+
42
+ const releaseDay = item.pubDate
43
+ ? dayjs(new Date(item.pubDate)).format("DD")
44
+ : null;
45
+
37
46
  const releaseDate = item.pubDate
38
47
  ? dayjs(new Date(item.pubDate)).format("YYYYMMDD")
39
48
  : null;
@@ -49,6 +58,8 @@ const getItemFilename = ({
49
58
  ["title", title],
50
59
  ["release_date", releaseDate || ""],
51
60
  ["release_year", releaseYear || ""],
61
+ ["release_month", releaseMonth || ""],
62
+ ["release_day", releaseDay || ""],
52
63
  ["episode_num", `${episodeNum}`.padStart(width, "0")],
53
64
  ["url", url],
54
65
  ["podcast_title", feed.title || ""],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podcast-dl",
3
- "version": "10.1.0",
3
+ "version": "10.2.0",
4
4
  "description": "A CLI for downloading podcasts.",
5
5
  "type": "module",
6
6
  "bin": "./bin/bin.js",