@mkterswingman/5mghost-yonder 0.0.16 → 0.0.18
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/dist/cli/index.js +2 -2
- package/dist/cli/setup.js +23 -8
- package/dist/cli/setupCookies.d.ts +5 -1
- package/dist/cli/setupCookies.js +9 -1
- package/package.json +1 -1
- package/scripts/install.ps1 +1 -7
- package/scripts/install.sh +1 -12
package/dist/cli/index.js
CHANGED
|
@@ -82,8 +82,8 @@ async function main() {
|
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
case "setup-cookies": {
|
|
85
|
-
const { runSetupCookies } = await import("./setupCookies.js");
|
|
86
|
-
await runSetupCookies();
|
|
85
|
+
const { runSetupCookies, parseSetupCookiesArgs } = await import("./setupCookies.js");
|
|
86
|
+
await runSetupCookies({}, parseSetupCookiesArgs(process.argv.slice(3)));
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
case "uninstall": {
|
package/dist/cli/setup.js
CHANGED
|
@@ -38,6 +38,13 @@ function tryRegisterMcp(cmd, label) {
|
|
|
38
38
|
console.log(` ⚠️ ${label} registration timed out after ${MCP_REGISTER_TIMEOUT_MS}ms — skipped auto-register.`);
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
|
+
const summary = failure.output.replace(/\s+/g, " ").trim().slice(0, 240);
|
|
42
|
+
if (summary) {
|
|
43
|
+
console.log(` ⚠️ ${label} auto-register failed: ${summary}`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log(` ⚠️ ${label} auto-register failed with no diagnostic output.`);
|
|
47
|
+
}
|
|
41
48
|
return false;
|
|
42
49
|
}
|
|
43
50
|
}
|
|
@@ -115,6 +122,9 @@ export function getCookieSetupDeferredHint() {
|
|
|
115
122
|
];
|
|
116
123
|
}
|
|
117
124
|
export async function runSetup() {
|
|
125
|
+
const installerMode = process.env.YT_MCP_INSTALLER_MODE === "1";
|
|
126
|
+
const skipCookieStep = installerMode || process.env.YT_MCP_SETUP_SKIP_COOKIES === "1";
|
|
127
|
+
const quietSummary = installerMode || process.env.YT_MCP_SETUP_QUIET_SUMMARY === "1";
|
|
118
128
|
console.log("\n🚀 yt-mcp setup\n");
|
|
119
129
|
ensureConfigDir();
|
|
120
130
|
const hasBrowser = canOpenBrowser();
|
|
@@ -228,7 +238,10 @@ export async function runSetup() {
|
|
|
228
238
|
}
|
|
229
239
|
// ── Step 4: YouTube Cookies ──
|
|
230
240
|
console.log("Step 4/5: YouTube cookies...");
|
|
231
|
-
if (
|
|
241
|
+
if (skipCookieStep) {
|
|
242
|
+
console.log(" ℹ️ Deferred to installer cookie flow");
|
|
243
|
+
}
|
|
244
|
+
else if (!hasBrowser) {
|
|
232
245
|
for (const line of getCookieSetupDeferredHint()) {
|
|
233
246
|
console.log(line);
|
|
234
247
|
}
|
|
@@ -322,12 +335,14 @@ export async function runSetup() {
|
|
|
322
335
|
console.log(" - Output path: ~/Downloads/yt-mcp/YYYY-MM-DD_<video_id>");
|
|
323
336
|
console.log(" - `ffmpeg` is required for video download modes");
|
|
324
337
|
console.log("");
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
338
|
+
if (!quietSummary) {
|
|
339
|
+
console.log("✅ Setup complete!");
|
|
340
|
+
if (hasBrowser) {
|
|
341
|
+
console.log(' Open your AI client and try: "搜索 Python 教程"');
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
console.log(" Set YT_MCP_TOKEN in your MCP env config, then restart your AI client.");
|
|
345
|
+
}
|
|
346
|
+
console.log("");
|
|
331
347
|
}
|
|
332
|
-
console.log("");
|
|
333
348
|
}
|
|
@@ -51,6 +51,9 @@ export interface SetupCookiesDeps {
|
|
|
51
51
|
runManualCookieSetup: typeof runManualCookieSetup;
|
|
52
52
|
log: (message: string) => void;
|
|
53
53
|
}
|
|
54
|
+
export interface SetupCookiesOptions {
|
|
55
|
+
importOnly?: boolean;
|
|
56
|
+
}
|
|
54
57
|
type SetupCookiesChromium = Awaited<ReturnType<SetupCookiesDeps["loadChromium"]>>;
|
|
55
58
|
interface CdpCookie {
|
|
56
59
|
name: string;
|
|
@@ -76,5 +79,6 @@ export declare function runManualCookieSetup(chromium: SetupCookiesChromium, dep
|
|
|
76
79
|
/**
|
|
77
80
|
* Interactive cookie setup — opens a visible browser for user to log in.
|
|
78
81
|
*/
|
|
79
|
-
export declare function
|
|
82
|
+
export declare function parseSetupCookiesArgs(argv: string[]): SetupCookiesOptions;
|
|
83
|
+
export declare function runSetupCookies(overrides?: Partial<SetupCookiesDeps>, options?: SetupCookiesOptions): Promise<void>;
|
|
80
84
|
export {};
|
package/dist/cli/setupCookies.js
CHANGED
|
@@ -361,7 +361,12 @@ export async function runManualCookieSetup(chromium, deps) {
|
|
|
361
361
|
/**
|
|
362
362
|
* Interactive cookie setup — opens a visible browser for user to log in.
|
|
363
363
|
*/
|
|
364
|
-
export
|
|
364
|
+
export function parseSetupCookiesArgs(argv) {
|
|
365
|
+
return {
|
|
366
|
+
importOnly: argv.includes("--import-only"),
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
export async function runSetupCookies(overrides = {}, options = {}) {
|
|
365
370
|
const deps = buildSetupCookiesDeps(overrides);
|
|
366
371
|
deps.log("\n🍪 YouTube Cookie Setup\n");
|
|
367
372
|
deps.ensureConfigDir();
|
|
@@ -376,5 +381,8 @@ export async function runSetupCookies(overrides = {}) {
|
|
|
376
381
|
if (imported) {
|
|
377
382
|
return;
|
|
378
383
|
}
|
|
384
|
+
if (options.importOnly) {
|
|
385
|
+
throw new Error("No reusable YouTube session found in local Chrome/Edge profiles");
|
|
386
|
+
}
|
|
379
387
|
await deps.runManualCookieSetup(chromium, deps);
|
|
380
388
|
}
|
package/package.json
CHANGED
package/scripts/install.ps1
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
$ErrorActionPreference = "Stop"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
winget install OpenJS.NodeJS.LTS
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
npm install -g @mkterswingman/5mghost-yonder
|
|
8
|
-
yt-mcp runtime install
|
|
9
|
-
yt-mcp setup
|
|
3
|
+
irm https://mkterswingman.com/install/yt-mcp.ps1 | iex
|
package/scripts/install.sh
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
if command -v brew >/dev/null 2>&1; then
|
|
6
|
-
brew install node
|
|
7
|
-
else
|
|
8
|
-
echo "Node.js is required. Install it first, then rerun this script." >&2
|
|
9
|
-
exit 1
|
|
10
|
-
fi
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
npm install -g @mkterswingman/5mghost-yonder
|
|
14
|
-
yt-mcp runtime install
|
|
15
|
-
yt-mcp setup
|
|
4
|
+
curl -fsSL https://mkterswingman.com/install/yt-mcp.sh | bash
|