podcast-dl 10.3.3 → 10.4.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 +1 -0
- package/bin/bin.js +3 -0
- package/bin/commander.js +4 -0
- package/bin/util.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ Type values surrounded in square brackets (`[]`) can be used as used as boolean
|
|
|
43
43
|
| --after | String | false | Only download episodes after this date (i.e. MM/DD/YYY, inclusive). |
|
|
44
44
|
| --before | String | false | Only download episodes before this date (i.e. MM/DD/YYY, inclusive) |
|
|
45
45
|
| --episode-regex | String | false | Match episode title against provided regex before starting download. |
|
|
46
|
+
| --episode-regex-exclude | String | false | Matched episode titles against provided regex will be excluded. |
|
|
46
47
|
| --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. |
|
|
47
48
|
| --episode-num-offset | Number | false | Offset the acquired episode number. Default is 0. |
|
|
48
49
|
| --episode-source-order | String | false | Attempted order to extract episode audio URL from RSS feed. Default is "enclosure,link". |
|
package/bin/bin.js
CHANGED
|
@@ -39,6 +39,7 @@ const {
|
|
|
39
39
|
episodeDigits,
|
|
40
40
|
episodeNumOffset,
|
|
41
41
|
episodeRegex,
|
|
42
|
+
episodeRegexExclude,
|
|
42
43
|
episodeSourceOrder,
|
|
43
44
|
episodeTemplate,
|
|
44
45
|
episodeCustomTemplateOptions,
|
|
@@ -114,6 +115,7 @@ const main = async () => {
|
|
|
114
115
|
after,
|
|
115
116
|
before,
|
|
116
117
|
episodeRegex,
|
|
118
|
+
episodeRegexExclude,
|
|
117
119
|
});
|
|
118
120
|
} else {
|
|
119
121
|
logErrorAndExit("No episodes found to list");
|
|
@@ -219,6 +221,7 @@ const main = async () => {
|
|
|
219
221
|
episodeDigits,
|
|
220
222
|
episodeNumOffset,
|
|
221
223
|
episodeRegex,
|
|
224
|
+
episodeRegexExclude,
|
|
222
225
|
episodeSourceOrder,
|
|
223
226
|
episodeTemplate,
|
|
224
227
|
episodeCustomTemplateOptions,
|
package/bin/commander.js
CHANGED
|
@@ -111,6 +111,10 @@ export const setupCommander = (program) => {
|
|
|
111
111
|
"--episode-regex <string>",
|
|
112
112
|
"match episode title against regex before downloading"
|
|
113
113
|
)
|
|
114
|
+
.option(
|
|
115
|
+
"--episode-regex-exclude <string>",
|
|
116
|
+
"matched episode titles against regex will be excluded"
|
|
117
|
+
)
|
|
114
118
|
.option(
|
|
115
119
|
"--after <string>",
|
|
116
120
|
"download episodes only after this date (inclusive)"
|
package/bin/util.js
CHANGED
|
@@ -166,6 +166,7 @@ const getItemsToDownload = ({
|
|
|
166
166
|
episodeDigits,
|
|
167
167
|
episodeNumOffset,
|
|
168
168
|
episodeRegex,
|
|
169
|
+
episodeRegexExclude,
|
|
169
170
|
episodeSourceOrder,
|
|
170
171
|
episodeTemplate,
|
|
171
172
|
episodeCustomTemplateOptions,
|
|
@@ -196,6 +197,13 @@ const getItemsToDownload = ({
|
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
|
|
200
|
+
if (episodeRegexExclude) {
|
|
201
|
+
const generatedEpisodeRegexExclude = new RegExp(episodeRegexExclude);
|
|
202
|
+
if (title && generatedEpisodeRegexExclude.test(title)) {
|
|
203
|
+
isValid = false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
199
207
|
if (before) {
|
|
200
208
|
const beforeDateDay = dayjs(new Date(before));
|
|
201
209
|
if (
|
|
@@ -336,6 +344,7 @@ const logItemsList = ({
|
|
|
336
344
|
before,
|
|
337
345
|
after,
|
|
338
346
|
episodeRegex,
|
|
347
|
+
episodeRegexExclude,
|
|
339
348
|
}) => {
|
|
340
349
|
const items = getItemsToDownload({
|
|
341
350
|
feed,
|
|
@@ -345,6 +354,7 @@ const logItemsList = ({
|
|
|
345
354
|
before,
|
|
346
355
|
after,
|
|
347
356
|
episodeRegex,
|
|
357
|
+
episodeRegexExclude,
|
|
348
358
|
});
|
|
349
359
|
|
|
350
360
|
if (!items.length) {
|