podcast-dl 10.3.2 → 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 +13 -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
|
@@ -13,6 +13,9 @@ const isWin = process.platform === "win32";
|
|
|
13
13
|
|
|
14
14
|
const defaultRssParserConfig = {
|
|
15
15
|
defaultRSS: 2.0,
|
|
16
|
+
headers: {
|
|
17
|
+
Accept: "*/*",
|
|
18
|
+
},
|
|
16
19
|
customFields: {
|
|
17
20
|
item: [["podcast:transcript", "podcastTranscripts", { keepArray: true }]],
|
|
18
21
|
},
|
|
@@ -163,6 +166,7 @@ const getItemsToDownload = ({
|
|
|
163
166
|
episodeDigits,
|
|
164
167
|
episodeNumOffset,
|
|
165
168
|
episodeRegex,
|
|
169
|
+
episodeRegexExclude,
|
|
166
170
|
episodeSourceOrder,
|
|
167
171
|
episodeTemplate,
|
|
168
172
|
episodeCustomTemplateOptions,
|
|
@@ -193,6 +197,13 @@ const getItemsToDownload = ({
|
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
|
|
200
|
+
if (episodeRegexExclude) {
|
|
201
|
+
const generatedEpisodeRegexExclude = new RegExp(episodeRegexExclude);
|
|
202
|
+
if (title && generatedEpisodeRegexExclude.test(title)) {
|
|
203
|
+
isValid = false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
196
207
|
if (before) {
|
|
197
208
|
const beforeDateDay = dayjs(new Date(before));
|
|
198
209
|
if (
|
|
@@ -333,6 +344,7 @@ const logItemsList = ({
|
|
|
333
344
|
before,
|
|
334
345
|
after,
|
|
335
346
|
episodeRegex,
|
|
347
|
+
episodeRegexExclude,
|
|
336
348
|
}) => {
|
|
337
349
|
const items = getItemsToDownload({
|
|
338
350
|
feed,
|
|
@@ -342,6 +354,7 @@ const logItemsList = ({
|
|
|
342
354
|
before,
|
|
343
355
|
after,
|
|
344
356
|
episodeRegex,
|
|
357
|
+
episodeRegexExclude,
|
|
345
358
|
});
|
|
346
359
|
|
|
347
360
|
if (!items.length) {
|