podcast-dl 10.1.0 → 10.3.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 +4 -1
- package/bin/async.js +1 -0
- package/bin/naming.js +11 -0
- package/bin/util.js +3 -1
- package/package.json +1 -1
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).
|
|
@@ -102,6 +104,7 @@ If no match is found, the `custom_<n>` keyword will be replaced with an empty st
|
|
|
102
104
|
- `episode_path_base`: The path to the folder of the downloaded episode.
|
|
103
105
|
- `episode_filename`: The filename of the episode.
|
|
104
106
|
- `episode_filename_base`: The filename of the episode without its extension.
|
|
107
|
+
- `url`: URL of episode audio file.
|
|
105
108
|
|
|
106
109
|
## Log Levels
|
|
107
110
|
|
package/bin/async.js
CHANGED
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/bin/util.js
CHANGED
|
@@ -689,6 +689,7 @@ const runExec = async ({
|
|
|
689
689
|
basePath,
|
|
690
690
|
outputPodcastPath,
|
|
691
691
|
episodeFilename,
|
|
692
|
+
episodeAudioUrl,
|
|
692
693
|
}) => {
|
|
693
694
|
const episodeFilenameBase = episodeFilename.substring(
|
|
694
695
|
0,
|
|
@@ -699,7 +700,8 @@ const runExec = async ({
|
|
|
699
700
|
.replace(/{{episode_path}}/g, `"${outputPodcastPath}"`)
|
|
700
701
|
.replace(/{{episode_path_base}}/g, `"${basePath}"`)
|
|
701
702
|
.replace(/{{episode_filename}}/g, `"${episodeFilename}"`)
|
|
702
|
-
.replace(/{{episode_filename_base}}/g, `"${episodeFilenameBase}"`)
|
|
703
|
+
.replace(/{{episode_filename_base}}/g, `"${episodeFilenameBase}"`)
|
|
704
|
+
.replace(/{{url}}/g, `"${episodeAudioUrl}"`);
|
|
703
705
|
|
|
704
706
|
await execWithPromise(execCmd, { stdio: "ignore" });
|
|
705
707
|
};
|