podcast-dl 7.0.0-async.0 → 7.0.0-async.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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [7.0.0-async.1](https://github.com/lightpohl/podcast-dl/compare/v7.0.0-async.0...v7.0.0-async.1) (2021-09-26)
6
+
7
+
8
+ ### Features
9
+
10
+ * check for ffmpeg during validation if option requires it ([d8638d2](https://github.com/lightpohl/podcast-dl/commit/d8638d26b7deafc4b025a827214fbbc276a536ea))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * set max on number of threads to 32 ([22b8b99](https://github.com/lightpohl/podcast-dl/commit/22b8b997c1272d8bd5448f7c169c88e24fa450e3))
16
+
5
17
  ## [7.0.0-async.0](https://github.com/lightpohl/podcast-dl/compare/v6.1.0...v7.0.0-async.0) (2021-09-22)
6
18
 
7
19
 
package/README.md CHANGED
@@ -6,14 +6,6 @@
6
6
 
7
7
  ## How to Use
8
8
 
9
- ### Binaries
10
-
11
- [Visit the releases page](https://github.com/lightpohl/podcast-dl/releases) and download the latest binary for your system.
12
-
13
- `podcast-dl --url <PODCAST_RSS_URL>`
14
-
15
- `podcast-dl --url "http://friendsatthetable.libsyn.com/rss"`
16
-
17
9
  ### npx
18
10
 
19
11
  **[Node Required](https://nodejs.org/en/)**
@@ -24,30 +16,31 @@
24
16
 
25
17
  Type values surrounded in square brackets (`[]`) can be used as used as boolean options (no argument required).
26
18
 
27
- | Option | Type | Required | Description |
28
- | ----------------------- | ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
- | --url | String | true | URL to podcast RSS feed. |
30
- | --out-dir | String | false | Specify output directory for episodes and metadata. Defaults to "./{{podcast_title}}". See "Templating" for more details. |
31
- | --archive | [String] | false | Download or write out items not listed in archive file. Generates archive file at path if not found. Defaults to "./{{podcast_title}}/archive.json" when used as a boolean option. See "Templating" for more details. |
32
- | --episode-template | String | false | Template for generating episode related filenames. See "Templating" for details. |
33
- | --include-meta | | false | Write out podcast metadata to JSON. |
34
- | --include-episode-meta | | false | Write out individual episode metadata to JSON. |
35
- | --ignore-episode-images | | false | Ignore downloading found images from --include-episode-meta. |
36
- | --offset | Number | false | Offset starting download position. Default is 0. |
37
- | --limit | Number | false | Max number of episodes to download. Downloads all by default. |
38
- | --after | String | false | Only download episodes after this date (i.e. MM/DD/YYY, inclusive). |
39
- | --before | String | false | Only download episodes before this date (i.e. MM/DD/YYY, inclusive) |
40
- | --episode-regex | String | false | Match episode title against provided regex before starting download. |
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**) |
42
- | --adjust-bitrate | String (e.g. "48k") | false | Attempts to adjust bitrate of MP3s. (**ffmpeg required**) |
43
- | --mono | | false | Attempts to force MP3s into mono. (**ffmpeg required**) |
44
- | --override | | false | Override local files on collision. |
45
- | --reverse | | false | Reverse download direction and start at last RSS item. |
46
- | --info | | false | Print retrieved podcast info instead of downloading. |
47
- | --list | [String] | false | Print episode list instead of downloading. Defaults to "table" when used as a boolean option. "json" is also supported. |
48
- | --exec | String | false | Execute a command after each episode is downloaded. |
49
- | --version | | false | Output the version number. |
50
- | --help | | false | Output usage information. |
19
+ | Option | Type | Required | Description |
20
+ | ------------------------ | ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | --url | String | true | URL to podcast RSS feed. |
22
+ | --out-dir | String | false | Specify output directory for episodes and metadata. Defaults to "./{{podcast_title}}". See "Templating" for more details. |
23
+ | --archive | [String] | false | Download or write out items not listed in archive file. Generates archive file at path if not found. Defaults to "./{{podcast_title}}/archive.json" when used as a boolean option. See "Templating" for more details. |
24
+ | --episode-template | String | false | Template for generating episode related filenames. See "Templating" for details. |
25
+ | --include-meta | | false | Write out podcast metadata to JSON. |
26
+ | --include-episode-meta | | false | Write out individual episode metadata to JSON. |
27
+ | --include-episode-images | | false | Download found episode images. |
28
+ | --offset | Number | false | Offset starting download position. Default is 0. |
29
+ | --limit | Number | false | Max number of episodes to download. Downloads all by default. |
30
+ | --after | String | false | Only download episodes after this date (i.e. MM/DD/YYY, inclusive). |
31
+ | --before | String | false | Only download episodes before this date (i.e. MM/DD/YYY, inclusive) |
32
+ | --episode-regex | String | false | Match episode title against provided regex before starting download. |
33
+ | --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**) |
34
+ | --adjust-bitrate | String (e.g. "48k") | false | Attempts to adjust bitrate of MP3s. (**ffmpeg required**) |
35
+ | --mono | | false | Attempts to force MP3s into mono. (**ffmpeg required**) |
36
+ | --override | | false | Override local files on collision. |
37
+ | --reverse | | false | Reverse download direction and start at last RSS item. |
38
+ | --info | | false | Print retrieved podcast info instead of downloading. |
39
+ | --list | [String] | false | Print episode list instead of downloading. Defaults to "table" when used as a boolean option. "json" is also supported. |
40
+ | --exec | String | false | Execute a command after each episode is downloaded. |
41
+ | --threads | Number | false | Determines the number of downloads that will happen concurrently. Default is 1. |
42
+ | --version | | false | Output the version number. |
43
+ | --help | | false | Output usage information. |
51
44
 
52
45
  ## Archive
53
46
 
package/bin/bin.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  writeFeedMeta,
20
20
  ITEM_LIST_FORMATS,
21
21
  } from "./util.js";
22
- import { createParseNumber } from "./validate.js";
22
+ import { createParseNumber, hasFfmpeg } from "./validate.js";
23
23
  import {
24
24
  ERROR_STATUSES,
25
25
  LOG_LEVELS,
@@ -51,7 +51,7 @@ commander
51
51
  "--include-episode-meta",
52
52
  "write out individual episode metadata to json"
53
53
  )
54
- .option("--include-episode-images", "include found episode images")
54
+ .option("--include-episode-images", "download found episode images")
55
55
  .option(
56
56
  "--offset <number>",
57
57
  "offset episode to start downloading from (most recent = 0)",
@@ -77,13 +77,19 @@ commander
77
77
  )
78
78
  .option(
79
79
  "--add-mp3-metadata",
80
- "attempts to add a base level of metadata to .mp3 files using ffmpeg"
80
+ "attempts to add a base level of metadata to .mp3 files using ffmpeg",
81
+ hasFfmpeg
81
82
  )
82
83
  .option(
83
84
  "--adjust-bitrate <string>",
84
- "attempts to adjust bitrate of .mp3 files using ffmpeg"
85
+ "attempts to adjust bitrate of .mp3 files using ffmpeg",
86
+ hasFfmpeg
87
+ )
88
+ .option(
89
+ "--mono",
90
+ "attempts to force .mp3 files into mono using ffmpeg",
91
+ hasFfmpeg
85
92
  )
86
- .option("--mono", "attempts to force .mp3 files into mono using ffmpeg")
87
93
  .option("--override", "override local files on collision")
88
94
  .option("--reverse", "download episodes in reverse order")
89
95
  .option("--info", "print retrieved podcast info instead of downloading")
@@ -110,7 +116,7 @@ commander
110
116
  .option(
111
117
  "--threads <number>",
112
118
  "the number of downloads that can happen concurrently",
113
- createParseNumber({ min: 1, name: "threads" }),
119
+ createParseNumber({ min: 1, max: 32, name: "threads" }),
114
120
  1
115
121
  )
116
122
  .parse(process.argv);
package/bin/validate.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { sync as commandExistsSync } from "command-exists";
2
+
1
3
  import { logErrorAndExit } from "./logger.js";
2
4
 
3
5
  const createParseNumber = ({ min, name, required = true }) => {
@@ -24,4 +26,10 @@ const createParseNumber = ({ min, name, required = true }) => {
24
26
  };
25
27
  };
26
28
 
27
- export { createParseNumber };
29
+ const hasFfmpeg = () => {
30
+ if (!commandExistsSync("ffmpeg")) {
31
+ logErrorAndExit('option specified requires "ffmpeg" be available');
32
+ }
33
+ };
34
+
35
+ export { createParseNumber, hasFfmpeg };
package/package.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
2
  "name": "podcast-dl",
3
- "version": "7.0.0-async.0",
3
+ "version": "7.0.0-async.1",
4
4
  "description": "A CLI for downloading podcasts.",
5
5
  "type": "module",
6
6
  "bin": "./bin/bin.js",
7
7
  "scripts": {
8
- "build": "rimraf ./binaries && npm run pkg",
9
8
  "lint": "eslint ./bin",
10
- "pkg": "npx pkg ./ --targets node16-linux-x64,node16-win-x64,node16-macos-x64 --out-path ./binaries",
11
9
  "release": "standard-version"
12
10
  },
13
11
  "lint-staged": {
@@ -28,7 +26,7 @@
28
26
  "cli"
29
27
  ],
30
28
  "engines": {
31
- "node": ">=12.16.2"
29
+ "node": ">=14.17.6"
32
30
  },
33
31
  "repository": {
34
32
  "type": "git",
@@ -49,6 +47,7 @@
49
47
  "standard-version": "^9.0.0"
50
48
  },
51
49
  "dependencies": {
50
+ "command-exists": "^1.2.9",
52
51
  "commander": "^5.1.0",
53
52
  "dayjs": "^1.8.25",
54
53
  "filenamify": "^4.1.0",