podcast-dl 9.1.0 → 9.2.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/LICENSE +21 -21
- package/bin/async.js +316 -313
- package/bin/bin.js +261 -261
- package/bin/commander.js +2 -1
- package/bin/logger.js +92 -92
- package/bin/naming.js +96 -85
- package/bin/util.js +593 -565
- package/bin/validate.js +43 -43
- package/bin/version.js +2 -0
- package/package.json +63 -62
package/bin/validate.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { sync as commandExistsSync } from "command-exists";
|
|
2
|
-
|
|
3
|
-
import { logErrorAndExit } from "./logger.js";
|
|
4
|
-
|
|
5
|
-
const createParseNumber = ({ min, max, name, required = true }) => {
|
|
6
|
-
return (value) => {
|
|
7
|
-
if (!value && !required) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
let number = parseInt(value);
|
|
13
|
-
|
|
14
|
-
if (isNaN(number)) {
|
|
15
|
-
logErrorAndExit(`${name} must be a number`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (typeof min !== undefined && number < min) {
|
|
19
|
-
logErrorAndExit(`${name} must be >= ${min}`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (typeof max !== undefined && number > max) {
|
|
23
|
-
logErrorAndExit(
|
|
24
|
-
`${name} must be <= ${
|
|
25
|
-
max === Number.MAX_SAFE_INTEGER ? "Number.MAX_SAFE_INTEGER" : max
|
|
26
|
-
}`
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return number;
|
|
31
|
-
} catch (error) {
|
|
32
|
-
logErrorAndExit(`Unable to parse ${name}`);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const hasFfmpeg = () => {
|
|
38
|
-
if (!commandExistsSync("ffmpeg")) {
|
|
39
|
-
logErrorAndExit('option specified requires "ffmpeg" be available');
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { createParseNumber, hasFfmpeg };
|
|
1
|
+
import { sync as commandExistsSync } from "command-exists";
|
|
2
|
+
|
|
3
|
+
import { logErrorAndExit } from "./logger.js";
|
|
4
|
+
|
|
5
|
+
const createParseNumber = ({ min, max, name, required = true }) => {
|
|
6
|
+
return (value) => {
|
|
7
|
+
if (!value && !required) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
let number = parseInt(value);
|
|
13
|
+
|
|
14
|
+
if (isNaN(number)) {
|
|
15
|
+
logErrorAndExit(`${name} must be a number`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof min !== undefined && number < min) {
|
|
19
|
+
logErrorAndExit(`${name} must be >= ${min}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (typeof max !== undefined && number > max) {
|
|
23
|
+
logErrorAndExit(
|
|
24
|
+
`${name} must be <= ${
|
|
25
|
+
max === Number.MAX_SAFE_INTEGER ? "Number.MAX_SAFE_INTEGER" : max
|
|
26
|
+
}`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return number;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
logErrorAndExit(`Unable to parse ${name}`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const hasFfmpeg = () => {
|
|
38
|
+
if (!commandExistsSync("ffmpeg")) {
|
|
39
|
+
logErrorAndExit('option specified requires "ffmpeg" be available');
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { createParseNumber, hasFfmpeg };
|
package/bin/version.js
ADDED
package/package.json
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "podcast-dl",
|
|
3
|
-
"version": "9.1
|
|
4
|
-
"description": "A CLI for downloading podcasts.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": "./bin/bin.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "rimraf ./binaries && rimraf ./dist && node build.cjs",
|
|
9
|
-
"lint": "eslint ./bin"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"pre-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"eslint
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "podcast-dl",
|
|
3
|
+
"version": "9.2.1",
|
|
4
|
+
"description": "A CLI for downloading podcasts.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": "./bin/bin.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf ./binaries && rimraf ./dist && node build.cjs",
|
|
9
|
+
"lint": "eslint ./bin",
|
|
10
|
+
"version:generate": "npx genversion --es6 --semi ./bin/version.js"
|
|
11
|
+
},
|
|
12
|
+
"lint-staged": {
|
|
13
|
+
"*.{js,json,md}": [
|
|
14
|
+
"prettier --write"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"husky": {
|
|
18
|
+
"hooks": {
|
|
19
|
+
"pre-commit": "lint-staged",
|
|
20
|
+
"pre-push": "npm run lint"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"podcast",
|
|
25
|
+
"podcasts",
|
|
26
|
+
"downloader",
|
|
27
|
+
"cli"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=14.17.6"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/lightpohl/podcast-dl.git"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"bin"
|
|
38
|
+
],
|
|
39
|
+
"author": "Joshua Pohl",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"eslint": "^6.8.0",
|
|
43
|
+
"eslint-config-prettier": "^6.11.0",
|
|
44
|
+
"husky": "^4.2.5",
|
|
45
|
+
"lint-staged": "^10.1.7",
|
|
46
|
+
"pkg": "^5.8.0",
|
|
47
|
+
"prettier": "2.3.2",
|
|
48
|
+
"rimraf": "^3.0.2",
|
|
49
|
+
"webpack": "^5.75.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"command-exists": "^1.2.9",
|
|
53
|
+
"commander": "^5.1.0",
|
|
54
|
+
"dayjs": "^1.8.25",
|
|
55
|
+
"filenamify": "^6.0.0",
|
|
56
|
+
"global-agent": "^3.0.0",
|
|
57
|
+
"got": "^11.0.2",
|
|
58
|
+
"p-limit": "^4.0.0",
|
|
59
|
+
"pluralize": "^8.0.0",
|
|
60
|
+
"rss-parser": "^3.12.0",
|
|
61
|
+
"throttle-debounce": "^3.0.1"
|
|
62
|
+
}
|
|
63
|
+
}
|