podcast-dl 8.0.4 → 8.0.6
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 +1 -0
- package/bin/async.js +2 -0
- package/bin/bin.js +2 -0
- package/bin/commander.js +7 -1
- package/bin/naming.js +2 -2
- package/bin/util.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ Type values surrounded in square brackets (`[]`) can be used as used as boolean
|
|
|
37
37
|
| --after | String | false | Only download episodes after this date (i.e. MM/DD/YYY, inclusive). |
|
|
38
38
|
| --before | String | false | Only download episodes before this date (i.e. MM/DD/YYY, inclusive) |
|
|
39
39
|
| --episode-regex | String | false | Match episode title against provided regex before starting download. |
|
|
40
|
+
| --episode-digits | Number | false | Minimum number of digits to use for episode numbering (e.g. 3 would generate "001" instead of "1"). Default is 0. |
|
|
40
41
|
| --add-mp3-metadata | | false | Attempts to add a base level of MP3 metadata to each episode. Recommended only in cases where the original metadata is of poor quality. (**ffmpeg required**) |
|
|
41
42
|
| --adjust-bitrate | String (e.g. "48k") | false | Attempts to adjust bitrate of MP3s. (**ffmpeg required**) |
|
|
42
43
|
| --mono | | false | Attempts to force MP3s into mono. (**ffmpeg required**) |
|
package/bin/async.js
CHANGED
|
@@ -140,6 +140,7 @@ let downloadItemsAsync = async ({
|
|
|
140
140
|
basePath,
|
|
141
141
|
bitrate,
|
|
142
142
|
episodeTemplate,
|
|
143
|
+
episodeDigits,
|
|
143
144
|
exec,
|
|
144
145
|
feed,
|
|
145
146
|
includeEpisodeMeta,
|
|
@@ -171,6 +172,7 @@ let downloadItemsAsync = async ({
|
|
|
171
172
|
url: episodeAudioUrl,
|
|
172
173
|
ext: audioFileExt,
|
|
173
174
|
template: episodeTemplate,
|
|
175
|
+
width: episodeDigits,
|
|
174
176
|
});
|
|
175
177
|
const outputPodcastPath = _path.resolve(basePath, episodeFilename);
|
|
176
178
|
|
package/bin/bin.js
CHANGED
|
@@ -34,6 +34,7 @@ const {
|
|
|
34
34
|
url,
|
|
35
35
|
outDir,
|
|
36
36
|
episodeTemplate,
|
|
37
|
+
episodeDigits,
|
|
37
38
|
includeMeta,
|
|
38
39
|
includeEpisodeMeta,
|
|
39
40
|
includeEpisodeImages,
|
|
@@ -198,6 +199,7 @@ const main = async () => {
|
|
|
198
199
|
basePath,
|
|
199
200
|
bitrate,
|
|
200
201
|
episodeTemplate,
|
|
202
|
+
episodeDigits,
|
|
201
203
|
exec,
|
|
202
204
|
feed,
|
|
203
205
|
includeEpisodeMeta,
|
package/bin/commander.js
CHANGED
|
@@ -4,7 +4,7 @@ import { logErrorAndExit } from "./logger.js";
|
|
|
4
4
|
|
|
5
5
|
export const setupCommander = (commander, argv) => {
|
|
6
6
|
commander
|
|
7
|
-
.version("8.0.
|
|
7
|
+
.version("8.0.6")
|
|
8
8
|
.option("--url <string>", "url to podcast rss feed")
|
|
9
9
|
.option(
|
|
10
10
|
"--out-dir <path>",
|
|
@@ -20,6 +20,12 @@ export const setupCommander = (commander, argv) => {
|
|
|
20
20
|
"template for generating episode related filenames",
|
|
21
21
|
"{{release_date}}-{{title}}"
|
|
22
22
|
)
|
|
23
|
+
.option(
|
|
24
|
+
"--episode-digits <number>",
|
|
25
|
+
"minimum number of digits to use for episode numbering (leading zeros)",
|
|
26
|
+
createParseNumber({ min: 0, name: "--episode-digits" }),
|
|
27
|
+
1
|
|
28
|
+
)
|
|
23
29
|
.option("--include-meta", "write out podcast metadata to json")
|
|
24
30
|
.option(
|
|
25
31
|
"--include-episode-meta",
|
package/bin/naming.js
CHANGED
|
@@ -11,7 +11,7 @@ const getSafeName = (name) => {
|
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const getFilename = ({ item, ext, url, feed, template }) => {
|
|
14
|
+
const getFilename = ({ item, ext, url, feed, template, width }) => {
|
|
15
15
|
const episodeNum = feed.items.length - item._originalIndex;
|
|
16
16
|
const formattedPubDate = item.pubDate
|
|
17
17
|
? dayjs(new Date(item.pubDate)).format("YYYYMMDD")
|
|
@@ -20,7 +20,7 @@ const getFilename = ({ item, ext, url, feed, template }) => {
|
|
|
20
20
|
const templateReplacementsTuples = [
|
|
21
21
|
["title", item.title || ""],
|
|
22
22
|
["release_date", formattedPubDate || ""],
|
|
23
|
-
["episode_num", episodeNum],
|
|
23
|
+
["episode_num", `${episodeNum}`.padStart(width, "0")],
|
|
24
24
|
["url", url],
|
|
25
25
|
["podcast_title", feed.title || ""],
|
|
26
26
|
["podcast_link", feed.link || ""],
|
package/bin/util.js
CHANGED