podcast-dl 8.0.2 → 8.0.3

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 CHANGED
@@ -46,6 +46,7 @@ Type values surrounded in square brackets (`[]`) can be used as used as boolean
46
46
  | --list | [String] | false | Print episode list instead of downloading. Defaults to "table" when used as a boolean option. "json" is also supported. |
47
47
  | --exec | String | false | Execute a command after each episode is downloaded. See "Templating" for more details. |
48
48
  | --parser-config | String | false | Path to JSON file that will be parsed and used to override the default config passed to [rss-parser](https://github.com/rbren/rss-parser#xml-options). |
49
+ | --proxy | | false | Enable proxy support. Specify environment variables listed by [global-agent](https://github.com/gajus/global-agent#environment-variables). |
49
50
  | --version | | false | Output the version number. |
50
51
  | --help | | false | Output usage information. |
51
52
 
package/bin/bin.js CHANGED
@@ -4,6 +4,7 @@ import fs from "fs";
4
4
  import _path from "path";
5
5
  import commander from "commander";
6
6
  import pluralize from "pluralize";
7
+ import { bootstrap as bootstrapProxy } from "global-agent";
7
8
 
8
9
  import { setupCommander } from "./commander.js";
9
10
  import { download } from "./async.js";
@@ -49,6 +50,7 @@ const {
49
50
  mono,
50
51
  threads,
51
52
  parserConfig,
53
+ proxy,
52
54
  addMp3Metadata: addMp3MetadataFlag,
53
55
  adjustBitrate: bitrate,
54
56
  } = commander;
@@ -60,6 +62,10 @@ const main = async () => {
60
62
  logErrorAndExit("No URL provided");
61
63
  }
62
64
 
65
+ if (proxy) {
66
+ bootstrapProxy();
67
+ }
68
+
63
69
  const { hostname, pathname } = new URL(url);
64
70
  const archiveUrl = `${hostname}${pathname}`;
65
71
  const feed = await getFeed(url, parserConfig);
package/bin/commander.js CHANGED
@@ -4,7 +4,7 @@ import { logErrorAndExit } from "./logger.js";
4
4
 
5
5
  export const setupCommander = (commander, argv) => {
6
6
  commander
7
- .version("8.0.2")
7
+ .version("8.0.3")
8
8
  .option("--url <string>", "url to podcast rss feed")
9
9
  .option(
10
10
  "--out-dir <path>",
@@ -96,5 +96,6 @@ export const setupCommander = (commander, argv) => {
96
96
  "--parser-config <string>",
97
97
  "path to JSON config to override RSS parser"
98
98
  )
99
+ .option("--proxy", "enable proxy support via global-agent")
99
100
  .parse(argv);
100
101
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podcast-dl",
3
- "version": "8.0.2",
3
+ "version": "8.0.3",
4
4
  "description": "A CLI for downloading podcasts.",
5
5
  "type": "module",
6
6
  "bin": "./bin/bin.js",
@@ -52,6 +52,7 @@
52
52
  "commander": "^5.1.0",
53
53
  "dayjs": "^1.8.25",
54
54
  "filenamify": "^4.1.0",
55
+ "global-agent": "^3.0.0",
55
56
  "got": "^11.0.2",
56
57
  "p-limit": "^4.0.0",
57
58
  "pluralize": "^8.0.0",