podcast-dl 7.3.0 → 7.3.1

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/bin/async.js CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  writeItemMeta,
23
23
  writeToArchive,
24
24
  getUrlEmbed,
25
+ getIsInArchive,
25
26
  } from "./util.js";
26
27
 
27
28
  const pipeline = promisify(stream.pipeline);
@@ -44,6 +45,11 @@ const download = async ({
44
45
  return;
45
46
  }
46
47
 
48
+ if (key && archive && getIsInArchive({ key, archive })) {
49
+ logMessage("Download exists in archive. Skipping...");
50
+ return;
51
+ }
52
+
47
53
  let embeddedUrl = null;
48
54
  if (filterUrlTracking) {
49
55
  logMessage("Attempting to find embedded URL...");
package/bin/bin.js CHANGED
@@ -301,7 +301,7 @@ const main = async () => {
301
301
  true
302
302
  )} downloaded\n`
303
303
  );
304
- } else {
304
+ } else if (numEpisodesDownloaded > 0) {
305
305
  logMessage(
306
306
  `\nSuccessfully downloaded ${pluralize(
307
307
  "episode",
package/bin/util.js CHANGED
@@ -215,22 +215,20 @@ const getItemsToDownload = ({
215
215
  }),
216
216
  });
217
217
 
218
- if (!savedArchive.includes(episodeImageArchiveKey)) {
219
- const episodeImageName = getFilename({
220
- item,
221
- feed,
222
- url: episodeAudioUrl,
223
- ext: episodeImageFileExt,
224
- template: episodeTemplate,
225
- });
226
-
227
- const outputImagePath = path.resolve(basePath, episodeImageName);
228
- item._extra_downloads.push({
229
- url: episodeImageUrl,
230
- outputPath: outputImagePath,
231
- key: episodeImageArchiveKey,
232
- });
233
- }
218
+ const episodeImageName = getFilename({
219
+ item,
220
+ feed,
221
+ url: episodeAudioUrl,
222
+ ext: episodeImageFileExt,
223
+ template: episodeTemplate,
224
+ });
225
+
226
+ const outputImagePath = path.resolve(basePath, episodeImageName);
227
+ item._extra_downloads.push({
228
+ url: episodeImageUrl,
229
+ outputPath: outputImagePath,
230
+ key: episodeImageArchiveKey,
231
+ });
234
232
  }
235
233
  }
236
234
 
@@ -295,7 +293,7 @@ const logItemsList = ({
295
293
 
296
294
  const writeFeedMeta = ({ outputPath, feed, key, archive, override }) => {
297
295
  if (key && archive && getIsInArchive({ key, archive })) {
298
- logMessage("Feed metadata exists in archive. Skipping write...");
296
+ logMessage("Feed metadata exists in archive. Skipping...");
299
297
  return;
300
298
  }
301
299
 
@@ -312,7 +310,7 @@ const writeFeedMeta = ({ outputPath, feed, key, archive, override }) => {
312
310
  if (override || !fs.existsSync(outputPath)) {
313
311
  fs.writeFileSync(outputPath, JSON.stringify(output, null, 4));
314
312
  } else {
315
- logMessage("Feed metadata exists locally. Skipping write...");
313
+ logMessage("Feed metadata exists locally. Skipping...");
316
314
  }
317
315
 
318
316
  if (key && archive && !getIsInArchive({ key, archive })) {
@@ -338,9 +336,7 @@ const writeItemMeta = ({
338
336
  override,
339
337
  }) => {
340
338
  if (key && archive && getIsInArchive({ key, archive })) {
341
- logMessage(
342
- `${marker} | Episode metadata exists in archive. Skipping write...`
343
- );
339
+ logMessage(`${marker} | Episode metadata exists in archive. Skipping...`);
344
340
  return;
345
341
  }
346
342
 
@@ -355,9 +351,7 @@ const writeItemMeta = ({
355
351
  if (override || !fs.existsSync(outputPath)) {
356
352
  fs.writeFileSync(outputPath, JSON.stringify(output, null, 4));
357
353
  } else {
358
- logMessage(
359
- `${marker} | Episode metadata exists locally. Skipping write...`
360
- );
354
+ logMessage(`${marker} | Episode metadata exists locally. Skipping...`);
361
355
  }
362
356
 
363
357
  if (key && archive && !getIsInArchive({ key, archive })) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podcast-dl",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "description": "A CLI for downloading podcasts.",
5
5
  "type": "module",
6
6
  "bin": "./bin/bin.js",