@jakende/media-info-cli 0.1.2 → 0.1.4

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jakob Endemann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -88,10 +88,19 @@ npm install -g @jakende/media-info-cli
88
88
  media-info-cli
89
89
  ```
90
90
 
91
- On first run, the npm wrapper creates a Python virtual environment in `~/.media-information-download/venv` and installs the Python dependencies there. To use a different venv location:
91
+ On first run, the npm wrapper creates a Python virtual environment in `~/.media-information-download/venv` and installs the Python dependencies there. Npm installs write generated media and transcripts to `~/.media-information-download/output` by default.
92
+
93
+ To create a Desktop alias/shortcut to the output folder:
94
+
95
+ ```bash
96
+ media-info-cli --desktop-output-alias
97
+ ```
98
+
99
+ To use a different venv or output location:
92
100
 
93
101
  ```bash
94
102
  MEDIA_INFORMATION_DOWNLOAD_VENV=/path/to/venv media-information-download
103
+ MEDIA_OUTPUT_DIR=/path/to/output media-information-download
95
104
  ```
96
105
 
97
106
  ## TUI
@@ -192,3 +201,7 @@ All generated audio is saved as `.mp3`. Non-MP3 RSS downloads are converted and
192
201
  - `media_information_download/tui.py`: terminal UI and non-interactive CLI entry point
193
202
 
194
203
  This structure keeps new media sources or formats isolated to source handlers, downloaders, and supported format lists.
204
+
205
+ ## License
206
+
207
+ MIT. See `LICENSE`.
@@ -10,10 +10,14 @@ const packageRoot = path.resolve(__dirname, "..");
10
10
  const venvRoot = process.env.MEDIA_INFORMATION_DOWNLOAD_VENV
11
11
  ? path.resolve(process.env.MEDIA_INFORMATION_DOWNLOAD_VENV)
12
12
  : path.join(os.homedir(), ".media-information-download", "venv");
13
+ const outputRoot = process.env.MEDIA_OUTPUT_DIR
14
+ ? path.resolve(process.env.MEDIA_OUTPUT_DIR)
15
+ : path.join(os.homedir(), ".media-information-download", "output");
13
16
  const isWindows = process.platform === "win32";
14
17
  const venvPython = isWindows
15
18
  ? path.join(venvRoot, "Scripts", "python.exe")
16
19
  : path.join(venvRoot, "bin", "python");
20
+ const desktopAliasArgs = new Set(["--desktop-output-alias", "--create-desktop-output-alias"]);
17
21
 
18
22
  function run(command, args, options = {}) {
19
23
  const result = spawnSync(command, args, {
@@ -21,6 +25,7 @@ function run(command, args, options = {}) {
21
25
  stdio: options.stdio || "inherit",
22
26
  env: {
23
27
  ...process.env,
28
+ MEDIA_OUTPUT_DIR: outputRoot,
24
29
  MEDIA_INFORMATION_DOWNLOAD_VENV: venvRoot,
25
30
  PYTHONPATH: packageRoot,
26
31
  },
@@ -92,11 +97,57 @@ function warnIfFfmpegMissing() {
92
97
  }
93
98
  }
94
99
 
100
+ function splitWrapperArgs(args) {
101
+ return {
102
+ createDesktopOutputAlias: args.some((arg) => desktopAliasArgs.has(arg)),
103
+ appArgs: args.filter((arg) => !desktopAliasArgs.has(arg)),
104
+ };
105
+ }
106
+
107
+ function pathToFileUrl(value) {
108
+ return `file:///${value.replace(/\\/g, "/").replace(/^\/+/, "")}`;
109
+ }
110
+
111
+ function createDesktopOutputAlias() {
112
+ const desktopPath = path.join(os.homedir(), "Desktop");
113
+ const aliasName = "Media Information Download Output";
114
+ const aliasPath = path.join(desktopPath, aliasName);
115
+
116
+ fs.mkdirSync(outputRoot, { recursive: true });
117
+ fs.mkdirSync(desktopPath, { recursive: true });
118
+ if (fs.existsSync(aliasPath)) {
119
+ console.log(`Output alias already exists: ${aliasPath}`);
120
+ return;
121
+ }
122
+
123
+ if (isWindows) {
124
+ const command = `mklink /J "${aliasPath}" "${outputRoot}"`;
125
+ const result = spawnSync("cmd", ["/d", "/s", "/c", command], { stdio: "ignore" });
126
+ if (result.status === 0) {
127
+ console.log(`Created output alias: ${aliasPath}`);
128
+ return;
129
+ }
130
+
131
+ const shortcutPath = `${aliasPath}.url`;
132
+ fs.writeFileSync(shortcutPath, `[InternetShortcut]\nURL=${pathToFileUrl(outputRoot)}\n`, "utf8");
133
+ console.log(`Created output shortcut: ${shortcutPath}`);
134
+ return;
135
+ }
136
+
137
+ fs.symlinkSync(outputRoot, aliasPath, "dir");
138
+ console.log(`Created output alias: ${aliasPath}`);
139
+ }
140
+
141
+ const wrapperArgs = splitWrapperArgs(process.argv.slice(2));
142
+
95
143
  ensureVenv();
96
144
  ensureDependencies();
97
145
  warnIfFfmpegMissing();
146
+ if (wrapperArgs.createDesktopOutputAlias) {
147
+ createDesktopOutputAlias();
148
+ }
98
149
 
99
- const child = run(venvPython, [path.join(packageRoot, "media_tui.py"), ...process.argv.slice(2)]);
150
+ const child = run(venvPython, [path.join(packageRoot, "media_tui.py"), ...wrapperArgs.appArgs]);
100
151
  if (child.signal) {
101
152
  process.kill(process.pid, child.signal);
102
153
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@jakende/media-info-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Terminal app for downloading media from YouTube or RSS feeds, converting to MP3, and generating Whisper transcripts.",
5
- "license": "UNLICENSED",
5
+ "license": "MIT",
6
6
  "bin": {
7
7
  "media-information-download": "bin/media-information-download.js",
8
8
  "media-info-download": "bin/media-information-download.js",
@@ -17,6 +17,7 @@
17
17
  "requirements.txt",
18
18
  "requirements-transcribe.txt",
19
19
  "pyproject.toml",
20
+ "LICENSE",
20
21
  "README.md"
21
22
  ],
22
23
  "scripts": {
package/pyproject.toml CHANGED
@@ -4,9 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "media-information-download"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Terminal app for downloading media from YouTube or RSS feeds, converting to MP3, and generating Whisper transcripts."
9
9
  readme = "README.md"
10
+ license = { text = "MIT" }
10
11
  requires-python = ">=3.10"
11
12
  dependencies = [
12
13
  "yt-dlp>=2024.1.1",